Documentation ¶
Overview ¶
Package zipkin allows converting model.Trace to/from zipkin.thrift model.
Index ¶
- Constants
- Variables
- func DeserializeThrift(ctx context.Context, b []byte) ([]*zipkincore.Span, error)
- func SerializeThrift(ctx context.Context, spans []*zipkincore.Span) []byte
- func ToDomain(zSpans []*zipkincore.Span) (*model.Trace, error)
- func ToDomainSpan(zSpan *zipkincore.Span) ([]*model.Span, error)
Constants ¶
const (
// UnknownServiceName is serviceName we give to model.Process if we cannot find it anywhere in a Zipkin span
UnknownServiceName = "unknown-service-name"
)
Variables ¶
var ( // DefaultLogFieldKey is the log field key which translates directly into Zipkin's Annotation.Value, // provided it's the only field in the log. // In all other cases the fields are encoded into Annotation.Value as JSON string. // TODO move to domain model DefaultLogFieldKey = "event" // IPTagName is the Jaeger tag name for an IPv4/IPv6 IP address. // TODO move to domain model IPTagName = "ip" )
Functions ¶
func DeserializeThrift ¶ added in v1.9.0
DeserializeThrift decodes Thrift bytes to a list of spans.
func SerializeThrift ¶ added in v1.9.0
func SerializeThrift(ctx context.Context, spans []*zipkincore.Span) []byte
SerializeThrift is only used in tests.
func ToDomain ¶
func ToDomain(zSpans []*zipkincore.Span) (*model.Trace, error)
ToDomain transforms a trace in zipkin.thrift format into model.Trace. The transformation assumes that all spans have the same Trace ID. A valid model.Trace is always returned, even when there are errors. The errors are more of an "fyi", describing issues in the data. TODO consider using different return type instead of `error`.
func ToDomainSpan ¶
func ToDomainSpan(zSpan *zipkincore.Span) ([]*model.Span, error)
ToDomainSpan transforms a span in zipkin.thrift format into model.Span. A valid model.Span is always returned, even when there are errors. The errors are more of an "fyi", describing issues in the data. TODO consider using different return type instead of `error`.
Types ¶
This section is empty.