messagingconv
v1.47.0
Documentation
pkg.go.dev ↗Package messagingconv provides types and functionality for OpenTelemetry semantic conventions in the "messaging" namespace.
Types
ClientConsumedMessages
type ClientConsumedMessages struct {
metric.Int64Counter
}
ClientConsumedMessages is an instrument used to record metric values conforming to the "messaging.client.consumed.messages" semantic conventions. It represents the number of messages that were delivered to the application.
NewClientConsumedMessages
func NewClientConsumedMessages( m metric.Meter, opt ...metric.Int64CounterOption, ) (ClientConsumedMessages, error)
NewClientConsumedMessages returns a new ClientConsumedMessages instrument.
ClientConsumedMessages.Add
func (m ClientConsumedMessages) Add( ctx context.Context, incr int64, operationName string, system SystemAttr, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
The operationName is the the system-specific name of the messaging operation.
The system is the the messaging system as identified by the client instrumentation.
All additional attrs passed are included in the recorded value.
Records the number of messages pulled from the broker or number of messages dispatched to the application in push-based scenarios. The metric SHOULD be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, this counter is incremented when the message is received and not reported when it is processed.
ClientConsumedMessages.AttrConsumerGroupName
func (ClientConsumedMessages) AttrConsumerGroupName(val string) attribute.KeyValue
AttrConsumerGroupName returns an optional attribute for the "messaging.consumer.group.name" semantic convention. It represents the name of the consumer group with which a consumer is associated.
ClientConsumedMessages.AttrDestinationName
func (ClientConsumedMessages) AttrDestinationName(val string) attribute.KeyValue
AttrDestinationName returns an optional attribute for the "messaging.destination.name" semantic convention. It represents the message destination name.
ClientConsumedMessages.AttrDestinationPartitionID
func (ClientConsumedMessages) AttrDestinationPartitionID(val string) attribute.KeyValue
AttrDestinationPartitionID returns an optional attribute for the "messaging.destination.partition.id" semantic convention. It represents the identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`.
ClientConsumedMessages.AttrDestinationSubscriptionName
func (ClientConsumedMessages) AttrDestinationSubscriptionName(val string) attribute.KeyValue
AttrDestinationSubscriptionName returns an optional attribute for the "messaging.destination.subscription.name" semantic convention. It represents the name of the destination subscription from which a message is consumed.
ClientConsumedMessages.AttrDestinationTemplate
func (ClientConsumedMessages) AttrDestinationTemplate(val string) attribute.KeyValue
AttrDestinationTemplate returns an optional attribute for the "messaging.destination.template" semantic convention. It represents the low cardinality representation of the messaging destination name.
ClientConsumedMessages.AttrErrorType
func (ClientConsumedMessages) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue
AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.
ClientConsumedMessages.AttrServerAddress
func (ClientConsumedMessages) AttrServerAddress(val string) attribute.KeyValue
AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
ClientConsumedMessages.AttrServerPort
func (ClientConsumedMessages) AttrServerPort(val int) attribute.KeyValue
AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.
ClientConsumedMessages.Description
func (ClientConsumedMessages) Description() string
Description returns the semantic convention description of the instrument
ClientConsumedMessages.Inst
func (m ClientConsumedMessages) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
ClientConsumedMessages.Name
func (ClientConsumedMessages) Name() string
Name returns the semantic convention name of the instrument.
ClientConsumedMessages.Unit
func (ClientConsumedMessages) Unit() string
Unit returns the semantic convention unit of the instrument
ClientOperationDuration
type ClientOperationDuration struct {
metric.Float64Histogram
}
ClientOperationDuration is an instrument used to record metric values conforming to the "messaging.client.operation.duration" semantic conventions. It represents the duration of messaging operation initiated by a producer or consumer client.
NewClientOperationDuration
func NewClientOperationDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (ClientOperationDuration, error)
NewClientOperationDuration returns a new ClientOperationDuration instrument.
ClientOperationDuration.AttrConsumerGroupName
func (ClientOperationDuration) AttrConsumerGroupName(val string) attribute.KeyValue
AttrConsumerGroupName returns an optional attribute for the "messaging.consumer.group.name" semantic convention. It represents the name of the consumer group with which a consumer is associated.
ClientOperationDuration.AttrDestinationName
func (ClientOperationDuration) AttrDestinationName(val string) attribute.KeyValue
AttrDestinationName returns an optional attribute for the "messaging.destination.name" semantic convention. It represents the message destination name.
ClientOperationDuration.AttrDestinationPartitionID
func (ClientOperationDuration) AttrDestinationPartitionID(val string) attribute.KeyValue
AttrDestinationPartitionID returns an optional attribute for the "messaging.destination.partition.id" semantic convention. It represents the identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`.
ClientOperationDuration.AttrDestinationSubscriptionName
func (ClientOperationDuration) AttrDestinationSubscriptionName(val string) attribute.KeyValue
AttrDestinationSubscriptionName returns an optional attribute for the "messaging.destination.subscription.name" semantic convention. It represents the name of the destination subscription from which a message is consumed.
ClientOperationDuration.AttrDestinationTemplate
func (ClientOperationDuration) AttrDestinationTemplate(val string) attribute.KeyValue
AttrDestinationTemplate returns an optional attribute for the "messaging.destination.template" semantic convention. It represents the low cardinality representation of the messaging destination name.
ClientOperationDuration.AttrErrorType
func (ClientOperationDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue
AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.
ClientOperationDuration.AttrOperationType
func (ClientOperationDuration) AttrOperationType(val OperationTypeAttr) attribute.KeyValue
AttrOperationType returns an optional attribute for the "messaging.operation.type" semantic convention. It represents a string identifying the type of the messaging operation.
ClientOperationDuration.AttrServerAddress
func (ClientOperationDuration) AttrServerAddress(val string) attribute.KeyValue
AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
ClientOperationDuration.AttrServerPort
func (ClientOperationDuration) AttrServerPort(val int) attribute.KeyValue
AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.
ClientOperationDuration.Description
func (ClientOperationDuration) Description() string
Description returns the semantic convention description of the instrument
ClientOperationDuration.Inst
func (m ClientOperationDuration) Inst() metric.Float64Histogram
Inst returns the underlying metric instrument.
ClientOperationDuration.Name
func (ClientOperationDuration) Name() string
Name returns the semantic convention name of the instrument.
ClientOperationDuration.Record
func (m ClientOperationDuration) Record( ctx context.Context, val float64, operationName string, system SystemAttr, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The operationName is the the system-specific name of the messaging operation.
The system is the the messaging system as identified by the client instrumentation.
All additional attrs passed are included in the recorded value.
This metric SHOULD NOT be used to report processing duration - processing duration is reported in `messaging.process.duration` metric.
ClientOperationDuration.Unit
func (ClientOperationDuration) Unit() string
Unit returns the semantic convention unit of the instrument
ClientSentMessages
type ClientSentMessages struct {
metric.Int64Counter
}
ClientSentMessages is an instrument used to record metric values conforming to the "messaging.client.sent.messages" semantic conventions. It represents the number of messages producer attempted to send to the broker.
NewClientSentMessages
func NewClientSentMessages( m metric.Meter, opt ...metric.Int64CounterOption, ) (ClientSentMessages, error)
NewClientSentMessages returns a new ClientSentMessages instrument.
ClientSentMessages.Add
func (m ClientSentMessages) Add( ctx context.Context, incr int64, operationName string, system SystemAttr, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
The operationName is the the system-specific name of the messaging operation.
The system is the the messaging system as identified by the client instrumentation.
All additional attrs passed are included in the recorded value.
This metric MUST NOT count messages that were created but haven't yet been sent.
ClientSentMessages.AttrDestinationName
func (ClientSentMessages) AttrDestinationName(val string) attribute.KeyValue
AttrDestinationName returns an optional attribute for the "messaging.destination.name" semantic convention. It represents the message destination name.
ClientSentMessages.AttrDestinationPartitionID
func (ClientSentMessages) AttrDestinationPartitionID(val string) attribute.KeyValue
AttrDestinationPartitionID returns an optional attribute for the "messaging.destination.partition.id" semantic convention. It represents the identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`.
ClientSentMessages.AttrDestinationTemplate
func (ClientSentMessages) AttrDestinationTemplate(val string) attribute.KeyValue
AttrDestinationTemplate returns an optional attribute for the "messaging.destination.template" semantic convention. It represents the low cardinality representation of the messaging destination name.
ClientSentMessages.AttrErrorType
func (ClientSentMessages) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue
AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.
ClientSentMessages.AttrServerAddress
func (ClientSentMessages) AttrServerAddress(val string) attribute.KeyValue
AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
ClientSentMessages.AttrServerPort
func (ClientSentMessages) AttrServerPort(val int) attribute.KeyValue
AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.
ClientSentMessages.Description
func (ClientSentMessages) Description() string
Description returns the semantic convention description of the instrument
ClientSentMessages.Inst
func (m ClientSentMessages) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
ClientSentMessages.Name
func (ClientSentMessages) Name() string
Name returns the semantic convention name of the instrument.
ClientSentMessages.Unit
func (ClientSentMessages) Unit() string
Unit returns the semantic convention unit of the instrument
ErrorTypeAttr
type ErrorTypeAttr string
ErrorTypeAttr is an attribute conforming to the error.type semantic conventions. It represents the describes a class of error the operation ended with.
ErrorTypeOther
var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther is a fallback error value to be used when the instrumentation doesn't define a custom value.
OperationTypeAttr
type OperationTypeAttr string
OperationTypeAttr is an attribute conforming to the messaging.operation.type semantic conventions. It represents a string identifying the type of the messaging operation.
OperationTypeCreate (5 declarations)
var ( // OperationTypeCreate is a message is created. "Create" spans always refer to a // single message and are used to provide a unique creation context for messages // in batch sending scenarios. OperationTypeCreate OperationTypeAttr = "create" // OperationTypeSend is the one or more messages are provided for sending to an // intermediary. If a single message is sent, the context of the "Send" span can // be used as the creation context and no "Create" span needs to be created. OperationTypeSend OperationTypeAttr = "send" // OperationTypeReceive is the one or more messages are requested by a consumer. // This operation refers to pull-based scenarios, where consumers explicitly // call methods of messaging SDKs to receive messages. OperationTypeReceive OperationTypeAttr = "receive" // OperationTypeProcess is the one or more messages are processed by a consumer. OperationTypeProcess OperationTypeAttr = "process" // OperationTypeSettle is the one or more messages are settled. OperationTypeSettle OperationTypeAttr = "settle" )
ProcessDuration
type ProcessDuration struct {
metric.Float64Histogram
}
ProcessDuration is an instrument used to record metric values conforming to the "messaging.process.duration" semantic conventions. It represents the duration of processing operation.
NewProcessDuration
func NewProcessDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (ProcessDuration, error)
NewProcessDuration returns a new ProcessDuration instrument.
ProcessDuration.AttrConsumerGroupName
func (ProcessDuration) AttrConsumerGroupName(val string) attribute.KeyValue
AttrConsumerGroupName returns an optional attribute for the "messaging.consumer.group.name" semantic convention. It represents the name of the consumer group with which a consumer is associated.
ProcessDuration.AttrDestinationName
func (ProcessDuration) AttrDestinationName(val string) attribute.KeyValue
AttrDestinationName returns an optional attribute for the "messaging.destination.name" semantic convention. It represents the message destination name.
ProcessDuration.AttrDestinationPartitionID
func (ProcessDuration) AttrDestinationPartitionID(val string) attribute.KeyValue
AttrDestinationPartitionID returns an optional attribute for the "messaging.destination.partition.id" semantic convention. It represents the identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`.
ProcessDuration.AttrDestinationSubscriptionName
func (ProcessDuration) AttrDestinationSubscriptionName(val string) attribute.KeyValue
AttrDestinationSubscriptionName returns an optional attribute for the "messaging.destination.subscription.name" semantic convention. It represents the name of the destination subscription from which a message is consumed.
ProcessDuration.AttrDestinationTemplate
func (ProcessDuration) AttrDestinationTemplate(val string) attribute.KeyValue
AttrDestinationTemplate returns an optional attribute for the "messaging.destination.template" semantic convention. It represents the low cardinality representation of the messaging destination name.
ProcessDuration.AttrErrorType
func (ProcessDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue
AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.
ProcessDuration.AttrServerAddress
func (ProcessDuration) AttrServerAddress(val string) attribute.KeyValue
AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
ProcessDuration.AttrServerPort
func (ProcessDuration) AttrServerPort(val int) attribute.KeyValue
AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.
ProcessDuration.Description
func (ProcessDuration) Description() string
Description returns the semantic convention description of the instrument
ProcessDuration.Inst
func (m ProcessDuration) Inst() metric.Float64Histogram
Inst returns the underlying metric instrument.
ProcessDuration.Name
func (ProcessDuration) Name() string
Name returns the semantic convention name of the instrument.
ProcessDuration.Record
func (m ProcessDuration) Record( ctx context.Context, val float64, operationName string, system SystemAttr, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The operationName is the the system-specific name of the messaging operation.
The system is the the messaging system as identified by the client instrumentation.
All additional attrs passed are included in the recorded value.
This metric MUST be reported for operations with `messaging.operation.type` that matches `process`.
ProcessDuration.Unit
func (ProcessDuration) Unit() string
Unit returns the semantic convention unit of the instrument
SystemAttr
type SystemAttr string
SystemAttr is an attribute conforming to the messaging.system semantic conventions. It represents the messaging system as identified by the client instrumentation.
SystemActiveMQ (11 declarations)
var ( // SystemActiveMQ is the apache ActiveMQ. SystemActiveMQ SystemAttr = "activemq" // SystemAWSSQS is the amazon Simple Queue Service (SQS). SystemAWSSQS SystemAttr = "aws_sqs" // SystemEventGrid is the azure Event Grid. SystemEventGrid SystemAttr = "eventgrid" // SystemEventHubs is the azure Event Hubs. SystemEventHubs SystemAttr = "eventhubs" // SystemServiceBus is the azure Service Bus. SystemServiceBus SystemAttr = "servicebus" // SystemGCPPubSub is the google Cloud Pub/Sub. SystemGCPPubSub SystemAttr = "gcp_pubsub" // SystemJMS is the java Message Service. SystemJMS SystemAttr = "jms" // SystemKafka is the apache Kafka. SystemKafka SystemAttr = "kafka" // SystemRabbitMQ is the rabbitMQ. SystemRabbitMQ SystemAttr = "rabbitmq" // SystemRocketMQ is the apache RocketMQ. SystemRocketMQ SystemAttr = "rocketmq" // SystemPulsar is the apache Pulsar. SystemPulsar SystemAttr = "pulsar" )