Add JSON input support to zipkin plugin (#3150)

(cherry picked from commit 13a6b917c3)
This commit is contained in:
Chris Goller
2017-08-21 19:24:54 -05:00
committed by Daniel Nelson
parent 7254111d37
commit d4cd1b7eb4
16 changed files with 3103 additions and 517 deletions

View File

@@ -0,0 +1,41 @@
package trace
import (
"time"
)
// Trace is an array (or a series) of spans
type Trace []Span
//Span represents a specific zipkin span. It holds the majority of the same
// data as a zipkin span sent via the thrift protocol, but is presented in a
// format which is more straightforward for storage purposes.
type Span struct {
ID string
TraceID string // zipkin traceid high concat with traceid
Name string
ParentID string
ServiceName string
Timestamp time.Time // If zipkin input is nil then time.Now()
Duration time.Duration
Annotations []Annotation
BinaryAnnotations []BinaryAnnotation
}
// BinaryAnnotation represents a zipkin binary annotation. It contains
// all of the same fields as might be found in its zipkin counterpart.
type BinaryAnnotation struct {
Key string
Value string
Host string // annotation.endpoint.ipv4 + ":" + annotation.endpoint.port
ServiceName string
}
// Annotation represents an ordinary zipkin annotation. It contains the data fields
// which will become fields/tags in influxdb
type Annotation struct {
Timestamp time.Time
Value string
Host string // annotation.endpoint.ipv4 + ":" + annotation.endpoint.port
ServiceName string
}