Documentation ¶
Overview ¶
Package otelkafka instruments the github.com/confluentinc/confluent-kafka-go/v2 package and supports function based Producer and Consumer
The consumer's span will be created as a child of the producer's span.
Context propagation only works on Kafka versions higher than 0.11.0.0 which supports record headers. (https://archive.apache.org/dist/kafka/0.11.0.0/RELEASE_NOTES.html)
Based on: https://github.com/DataDog/dd-trace-go/tree/main/contrib/confluentinc/confluent-kafka-go/kafka.v2
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Consumer ¶
func WrapConsumer ¶
WrapConsumer wraps a kafka.Consumer so that any consumed events are traced.
type MessageCarrier ¶
type MessageCarrier struct {
// contains filtered or unexported fields
}
func NewMessageCarrier ¶
func NewMessageCarrier(msg *kafka.Message) *MessageCarrier
func (MessageCarrier) Get ¶
func (c MessageCarrier) Get(key string) string
func (MessageCarrier) Keys ¶
func (c MessageCarrier) Keys() []string
func (MessageCarrier) Set ¶
func (c MessageCarrier) Set(key string, value string)
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option interface used for setting optional config properties.
func WithPropagators ¶
func WithPropagators(propagators propagation.TextMapPropagator) Option
WithPropagators specifies propagators to use for extracting information from the HTTP requests. If none are specified, global ones will be used.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.