mqtt

package module
v0.0.0-...-a2050e4 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsumerInstrumenter

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

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 (*DeliverAttrsExtractor) OnStart

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 (DeliverAttrsGetter) GetSystem

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

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 (*PublishAttrsExtractor) OnStart

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 (PublishAttrsGetter) GetSystem

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

Jump to

Keyboard shortcuts

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