Documentation
¶
Index ¶
- func ConsumerInstrumenter() interface{ ... }
- func Enabled() bool
- func EndConsumer(ctx context.Context, req DeliverRequest, res DeliverResponse, err error)
- func EndDeliver(ctx context.Context, req DeliverRequest, res DeliverResponse, err error)
- func EndProducer(ctx context.Context, req PublishRequest, res PublishResponse, err error)
- func EndPublish(ctx context.Context, req PublishRequest, res PublishResponse, err error)
- func ProducerInstrumenter() interface{ ... }
- func StartConsumer(ctx context.Context, req DeliverRequest) context.Context
- func StartDeliver(ctx context.Context, req DeliverRequest) context.Context
- func StartProducer(ctx context.Context, req PublishRequest) context.Context
- func StartPublish(ctx context.Context, req PublishRequest) context.Context
- type ConsumerCarrier
- type DeliverAttrsExtractor
- type DeliverAttrsGetter
- func (g DeliverAttrsGetter) GetBatchMessageCount(DeliverRequest, DeliverResponse) int64
- func (g DeliverAttrsGetter) GetClientId(req DeliverRequest) string
- func (g DeliverAttrsGetter) GetConversationId(DeliverRequest) string
- func (g DeliverAttrsGetter) GetDestination(req DeliverRequest) string
- func (g DeliverAttrsGetter) GetDestinationPartitionId(DeliverRequest) string
- func (g DeliverAttrsGetter) GetDestinationTemplate(DeliverRequest) string
- func (g DeliverAttrsGetter) GetMessageBodySize(req DeliverRequest) int64
- func (g DeliverAttrsGetter) GetMessageEnvelopSize(DeliverRequest) int64
- func (g DeliverAttrsGetter) GetMessageHeader(req DeliverRequest, name string) []string
- func (g DeliverAttrsGetter) GetMessageId(req DeliverRequest, _ DeliverResponse) string
- func (g DeliverAttrsGetter) GetSystem(DeliverRequest) string
- func (g DeliverAttrsGetter) IsAnonymousDestination(DeliverRequest) bool
- func (g DeliverAttrsGetter) IsTemporaryDestination(DeliverRequest) bool
- type DeliverRequest
- type DeliverResponse
- type DeliverStatusExtractor
- type ProducerCarrier
- type PublishAttrsExtractor
- type PublishAttrsGetter
- func (g PublishAttrsGetter) GetBatchMessageCount(PublishRequest, PublishResponse) int64
- func (g PublishAttrsGetter) GetClientId(req PublishRequest) string
- func (g PublishAttrsGetter) GetConversationId(PublishRequest) string
- func (g PublishAttrsGetter) GetDestination(req PublishRequest) string
- func (g PublishAttrsGetter) GetDestinationPartitionId(PublishRequest) string
- func (g PublishAttrsGetter) GetDestinationTemplate(PublishRequest) string
- func (g PublishAttrsGetter) GetMessageBodySize(req PublishRequest) int64
- func (g PublishAttrsGetter) GetMessageEnvelopSize(PublishRequest) int64
- func (g PublishAttrsGetter) GetMessageHeader(req PublishRequest, name string) []string
- func (g PublishAttrsGetter) GetMessageId(req PublishRequest, _ PublishResponse) string
- func (g PublishAttrsGetter) GetSystem(PublishRequest) string
- func (g PublishAttrsGetter) IsAnonymousDestination(PublishRequest) bool
- func (g PublishAttrsGetter) IsTemporaryDestination(PublishRequest) bool
- type PublishRequest
- type PublishResponse
- type PublishStatusExtractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsumerInstrumenter ¶
func ConsumerInstrumenter() interface {
Start(context.Context, DeliverRequest, ...trace.SpanStartOption) context.Context
End(context.Context, DeliverRequest, DeliverResponse, error, ...trace.SpanEndOption)
}
ConsumerInstrumenter returns the instrumenter instance for MQTT consumer (deliver) operations The returned interface provides Start and End methods for creating and completing trace spans when the broker delivers messages to subscribed clients
func Enabled ¶
func Enabled() bool
Enabled returns whether MQTT instrumentation is enabled It checks the OTEL_INSTRUMENTATION_MQTT_ENABLED environment variable
func EndConsumer ¶
func EndConsumer(ctx context.Context, req DeliverRequest, res DeliverResponse, err error)
EndConsumer completes the trace span for an MQTT message delivery operation It should be called when the delivery operation finishes, either successfully or with an error
func EndDeliver ¶
func EndDeliver(ctx context.Context, req DeliverRequest, res DeliverResponse, err error)
func EndProducer ¶
func EndProducer(ctx context.Context, req PublishRequest, res PublishResponse, err error)
EndProducer completes the trace span for an MQTT publish operation It should be called when the publish operation finishes, either successfully or with an error
func EndPublish ¶
func EndPublish(ctx context.Context, req PublishRequest, res PublishResponse, err error)
func ProducerInstrumenter ¶
func ProducerInstrumenter() interface {
Start(context.Context, PublishRequest, ...trace.SpanStartOption) context.Context
End(context.Context, PublishRequest, PublishResponse, error, ...trace.SpanEndOption)
}
ProducerInstrumenter returns the instrumenter instance for MQTT producer (publish) operations The returned interface provides Start and End methods for creating and completing trace spans when a client publishes messages to the broker
func StartConsumer ¶
func StartConsumer(ctx context.Context, req DeliverRequest) context.Context
StartConsumer starts a new trace span for an MQTT message delivery operation It should be called when the broker is about to deliver a message to a subscribed client
func StartDeliver ¶
func StartDeliver(ctx context.Context, req DeliverRequest) context.Context
func StartProducer ¶
func StartProducer(ctx context.Context, req PublishRequest) context.Context
StartProducer starts a new trace span for an MQTT publish operation It should be called when a client publishes a message to the broker
func StartPublish ¶
func StartPublish(ctx context.Context, req PublishRequest) context.Context
Types ¶
type ConsumerCarrier ¶
type ConsumerCarrier struct {
// contains filtered or unexported fields
}
func (ConsumerCarrier) Get ¶
func (c ConsumerCarrier) Get(key string) string
func (ConsumerCarrier) Keys ¶
func (c ConsumerCarrier) Keys() []string
func (ConsumerCarrier) Set ¶
func (c ConsumerCarrier) Set(key, val string)
type DeliverAttrsExtractor ¶
type DeliverAttrsExtractor struct{}
func (*DeliverAttrsExtractor) OnEnd ¶
func (e *DeliverAttrsExtractor) OnEnd(attrs []attribute.KeyValue, ctx context.Context, _ DeliverRequest, _ DeliverResponse, err error) ([]attribute.KeyValue, context.Context)
type DeliverAttrsGetter ¶
type DeliverAttrsGetter struct{}
func (DeliverAttrsGetter) GetBatchMessageCount ¶
func (g DeliverAttrsGetter) GetBatchMessageCount(DeliverRequest, DeliverResponse) int64
func (DeliverAttrsGetter) GetClientId ¶
func (g DeliverAttrsGetter) GetClientId(req DeliverRequest) string
func (DeliverAttrsGetter) GetConversationId ¶
func (g DeliverAttrsGetter) GetConversationId(DeliverRequest) string
func (DeliverAttrsGetter) GetDestination ¶
func (g DeliverAttrsGetter) GetDestination(req DeliverRequest) string
func (DeliverAttrsGetter) GetDestinationPartitionId ¶
func (g DeliverAttrsGetter) GetDestinationPartitionId(DeliverRequest) string
func (DeliverAttrsGetter) GetDestinationTemplate ¶
func (g DeliverAttrsGetter) GetDestinationTemplate(DeliverRequest) string
func (DeliverAttrsGetter) GetMessageBodySize ¶
func (g DeliverAttrsGetter) GetMessageBodySize(req DeliverRequest) int64
func (DeliverAttrsGetter) GetMessageEnvelopSize ¶
func (g DeliverAttrsGetter) GetMessageEnvelopSize(DeliverRequest) int64
func (DeliverAttrsGetter) GetMessageHeader ¶
func (g DeliverAttrsGetter) GetMessageHeader(req DeliverRequest, name string) []string
func (DeliverAttrsGetter) GetMessageId ¶
func (g DeliverAttrsGetter) GetMessageId(req DeliverRequest, _ DeliverResponse) string
func (DeliverAttrsGetter) GetSystem ¶
func (g DeliverAttrsGetter) GetSystem(DeliverRequest) string
func (DeliverAttrsGetter) IsAnonymousDestination ¶
func (g DeliverAttrsGetter) IsAnonymousDestination(DeliverRequest) bool
func (DeliverAttrsGetter) IsTemporaryDestination ¶
func (g DeliverAttrsGetter) IsTemporaryDestination(DeliverRequest) bool
type DeliverRequest ¶
type DeliverRequest struct {
Packet packets.Packet // publish packet being delivered
ClientID string // subscriber client id
Remote string // subscriber remote address
}
DeliverRequest represents a request to deliver a published message from the broker to a subscriber. It is used in MQTT instrumentation to capture the details of a message delivery operation. The Packet field contains the publish packet being delivered, ClientID identifies the subscriber client, and Remote provides the subscriber's remote address.
type DeliverResponse ¶
type DeliverResponse struct{}
DeliverResponse represents the result of processing a DeliverRequest on the consumer (subscriber) side. This type is used as a placeholder for future extensions where additional response information may be needed after a delivery operation. Currently, it does not contain any fields.
type DeliverStatusExtractor ¶
type DeliverStatusExtractor struct{}
func (*DeliverStatusExtractor) Extract ¶
func (e *DeliverStatusExtractor) Extract(span trace.Span, _ DeliverRequest, _ DeliverResponse, err error)
type ProducerCarrier ¶
type ProducerCarrier struct {
// contains filtered or unexported fields
}
func (ProducerCarrier) Get ¶
func (c ProducerCarrier) Get(key string) string
func (ProducerCarrier) Keys ¶
func (c ProducerCarrier) Keys() []string
func (ProducerCarrier) Set ¶
func (c ProducerCarrier) Set(key, val string)
type PublishAttrsExtractor ¶
type PublishAttrsExtractor struct{}
func (*PublishAttrsExtractor) OnEnd ¶
func (e *PublishAttrsExtractor) OnEnd(attrs []attribute.KeyValue, ctx context.Context, _ PublishRequest, _ PublishResponse, err error) ([]attribute.KeyValue, context.Context)
type PublishAttrsGetter ¶
type PublishAttrsGetter struct{}
func (PublishAttrsGetter) GetBatchMessageCount ¶
func (g PublishAttrsGetter) GetBatchMessageCount(PublishRequest, PublishResponse) int64
func (PublishAttrsGetter) GetClientId ¶
func (g PublishAttrsGetter) GetClientId(req PublishRequest) string
func (PublishAttrsGetter) GetConversationId ¶
func (g PublishAttrsGetter) GetConversationId(PublishRequest) string
func (PublishAttrsGetter) GetDestination ¶
func (g PublishAttrsGetter) GetDestination(req PublishRequest) string
func (PublishAttrsGetter) GetDestinationPartitionId ¶
func (g PublishAttrsGetter) GetDestinationPartitionId(PublishRequest) string
func (PublishAttrsGetter) GetDestinationTemplate ¶
func (g PublishAttrsGetter) GetDestinationTemplate(PublishRequest) string
func (PublishAttrsGetter) GetMessageBodySize ¶
func (g PublishAttrsGetter) GetMessageBodySize(req PublishRequest) int64
func (PublishAttrsGetter) GetMessageEnvelopSize ¶
func (g PublishAttrsGetter) GetMessageEnvelopSize(PublishRequest) int64
func (PublishAttrsGetter) GetMessageHeader ¶
func (g PublishAttrsGetter) GetMessageHeader(req PublishRequest, name string) []string
func (PublishAttrsGetter) GetMessageId ¶
func (g PublishAttrsGetter) GetMessageId(req PublishRequest, _ PublishResponse) string
func (PublishAttrsGetter) GetSystem ¶
func (g PublishAttrsGetter) GetSystem(PublishRequest) string
func (PublishAttrsGetter) IsAnonymousDestination ¶
func (g PublishAttrsGetter) IsAnonymousDestination(PublishRequest) bool
func (PublishAttrsGetter) IsTemporaryDestination ¶
func (g PublishAttrsGetter) IsTemporaryDestination(PublishRequest) bool
type PublishRequest ¶
type PublishRequest struct {
Packet *packets.Packet // The MQTT publish packet
ClientID string // ID of the client publishing the message
Remote string // sender remote address
}
PublishRequest represents a request to publish a message from an MQTT client to the broker. It is used in MQTT instrumentation to capture the details of a publish operation initiated by a client. The Packet field contains the MQTT publish packet, ClientID identifies the publishing client, and Remote provides the sender's remote address.
type PublishResponse ¶
type PublishResponse struct{}
PublishResponse represents the result of processing a PublishRequest on the producer (client) side. This type is used as a placeholder for future extensions where additional response information may be needed after a publish operation. Currently, it does not contain any fields.
type PublishStatusExtractor ¶
type PublishStatusExtractor struct{}
func (*PublishStatusExtractor) Extract ¶
func (e *PublishStatusExtractor) Extract(span trace.Span, _ PublishRequest, _ PublishResponse, err error)