Documentation ¶
Overview ¶
Package tracing contains tracing logic for the segmentio/kafka-go.v0 instrumentation.
WARNING: this package SHOULD NOT import segmentio/kafka-go.
The motivation of this package is to support orchestrion, which cannot use the main package because it imports the segmentio/kafka-go package, and since orchestrion modifies the library code itself, this would cause an import cycle.
Index ¶
- type Header
- type KafkaConfig
- type KafkaHeader
- type Message
- type MessageCarrier
- type Option
- type Tracer
- func (*Tracer) FinishProduceSpan(span ddtrace.Span, partition int, offset int64, err error)
- func (tr *Tracer) SetConsumeDSMCheckpoint(msg Message)
- func (tr *Tracer) SetProduceDSMCheckpoint(msg Message, writer Writer)
- func (tr *Tracer) StartConsumeSpan(ctx context.Context, msg Message) ddtrace.Span
- func (tr *Tracer) StartProduceSpan(ctx context.Context, writer Writer, msg Message, ...) ddtrace.Span
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaConfig ¶
KafkaConfig holds information from the kafka config for span tags.
type KafkaHeader ¶
func (KafkaHeader) GetKey ¶
func (h KafkaHeader) GetKey() string
func (KafkaHeader) GetValue ¶
func (h KafkaHeader) GetValue() []byte
type MessageCarrier ¶
type MessageCarrier struct {
// contains filtered or unexported fields
}
A MessageCarrier implements TextMapReader/TextMapWriter for extracting/injecting traces on a kafka.Message
func NewMessageCarrier ¶
func NewMessageCarrier(msg Message) MessageCarrier
func (MessageCarrier) ForeachKey ¶
func (c MessageCarrier) ForeachKey(handler func(key, val string) error) error
ForeachKey conforms to the TextMapReader interface.
func (MessageCarrier) Set ¶
func (c MessageCarrier) Set(key, val string)
Set implements TextMapWriter
type Option ¶
type Option func(tr *Tracer)
An Option customizes the Tracer.
func WithAnalytics ¶
WithAnalytics enables Trace Analytics for all started spans.
func WithAnalyticsRate ¶
WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.
func WithDataStreams ¶
func WithDataStreams() Option
WithDataStreams enables the Data Streams monitoring product features: https://www.datadoghq.com/product/data-streams-monitoring/
func WithServiceName ¶
WithServiceName sets the Tracer service name to serviceName.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func NewTracer ¶
func NewTracer(kafkaCfg KafkaConfig, opts ...Option) *Tracer