go-kit-nats-zipkin-tracing

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2020 License: MIT

README

Go Kit NATS Zipkin Tracing

This package implements native zipkin tracing for NATS transport (Subscriber and Publisher) of Go Kit toolkit.

Context transfer

This package transfers the span context inside of a NATS message as a separate field natsSpanContextB3Map. b3.Map's Inject, Extract methods handle Serialization and deserialization of the context.
The nats.Msg.Data object structure to pass data and the context:

type natsMessageWithContext struct {
	Sc   b3.Map `json:"natsSpanContextB3Map"`
	Data []byte `json:"data"`
}

Data field holds marshalled nats.Msg.Data.

Make sure to use NATSPublisherTrace endpoints only with endpoints that use NATSSubscriberTrace to deserialize messages properly. Or use AllowPropagation option to disallow propagation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL