Skip to content

Instantly share code, notes, and snippets.

@lmolkova
Last active January 6, 2023 23:36
Show Gist options
  • Save lmolkova/489a2b280b8fa68e4c3780c2afaa3b39 to your computer and use it in GitHub Desktop.
Save lmolkova/489a2b280b8fa68e4c3780c2afaa3b39 to your computer and use it in GitHub Desktop.
Azure SDK metrics: conventions

OpenTelemetry Metrics Semantic Conventions for Azure Messaging Libraries

Context: https://gist.github.com/lmolkova/b9004307a09be788af04f05ebe22ad3c

Follows general OTel Metrics conventions and depends on OTel Messaging conventions changes

AMQP-level metric instruments

Name Description Units Instrument Type (*) Value Type Attribute Key(s) Attribute Values
messaging.az.amqp.producer.send.duration Measures duration of AMQP-level send call attempt ms Histogram Double net.peer.name Broker FQDN
messaging.destination (will change) Entity name
amqp.delivery_state Delivery state
messaging.az.amqp.management.request.duration Duration of AMQP request-response operation ms Histogram Double net.peer.name Broker FQDN
messaging.destination (will change) Entity name
amqp.status_code AMQP (HTTP) status code
amqp.operation AMQP request/response operation name
messaging.az.amqp.client.connections.closed Number of closed connections. {connections} Counter Int64 net.peer.name Broker FQDN
amqp.error_condition 'ok' or one of AMQP error conditions
messaging.az.amqp.client.transport.errors Number of transport errors {errors} Counter Int64 net.peer.name Broker FQDN
messaging.destination Entity name
amqp.error_condition 'ok' or one of AMQP error conditions
messaging.az.amqp.client.link.errors Number of AMQP links closed with error {errors} Counter Int64 net.peer.name Broker FQDN
messaging.destination Entity name
messaging.az.entity_path (when available) Entity path (includes partition id or subscription). It's could to be generalized in scope of OTel Messaging conventions changes
amqp.error_condition 'ok' or one of AMQP error conditions
messaging.az.amqp.client.session.errors Number of AMQP sessions closed with error {errors} Counter Int64 net.peer.name Broker FQDN
messaging.destination Entity name
messaging.az.entity_path (when available) Entity path (includes partition id or subscription)
amqp.error_condition 'ok' or one of AMQP error conditions
messaging.az.amqp.consumer.sequence_number Sequence number of the last message received from broker {seqNo} Gauge Long net.peer.name Broker FQDN
messaging.destination Entity name
messaging.az.entity_path Entity path (includes partition id or subscription)
messaging.az.amqp.consumer.credits.requested Number of requested credits {credits} Counter Int64 net.peer.name Broker FQDN
messaging.destination Entity name
messaging.az.entity_path Entity path (includes partition id or subscription)

ServiceBus

Name Description Units Instrument Type (*) Value Type Attribute Key(s) Attribute Values
messaging.servicebus.messages.sent Number of events sent {events} Counter Long net.peer.name Broker FQDN
messaging.destination (will change) Entity name
otel.status_code ok or error
messaging.servicebus.receiver.lag Approximate lag between the time message was received and the time it was enqueued on broker. seconds Histogram Double net.peer.name Broker FQDN
messaging.destination Entity name
messaging.servicebus.subscription_name Subscription name
messaging.servicebus.settlement.request.duration Duration of settlement call {ms} Histogram Double net.peer.name Broker FQDN
messaging.destination (will change) Entity name
messaging.servicebus.subscription_name Consumer group name
messaging.servicebus.disposition_status Disposition status: complete, abandon, defer, suspend (dead-letter)
otel.status_code ok or error
messaging.servicebus.settlement.sequence_number Last settled sequence number {seqNo} Gauge Long net.peer.name Broker FQDN
messaging.destination (will change) Entity name
messaging.servicebus.subscription_name Consumer group name
messaging.servicebus.disposition_status Disposition status: complete, abandon, defer, suspend (dead-letter)
otel.status_code ok or error

EventHubs

(almost the same as ServiceBus)

Name Description Units Instrument Type (*) Value Type Attribute Key(s) Attribute Values
messaging.eventhubs.events.sent Number of events sent {events} Counter Long net.peer.name Broker FQDN
messaging.destination (will change) Entity name
messaging.az.partition_id Partition id (if known at send time)
otel.status_code: ok or error
messaging.eventhubs.consumer.lag Approximate lag between the time message was received and the time it was enqueued on broker. seconds Histogram Double net.peer.name Broker FQDN
messaging.destination Entity name
messaging.az.partition_id Partition id
messaging.eventhubs.consumer_group Consumer group
messaging.eventhubs.checkpoint.count Number of checkpoint calls {calls} Counter Long net.peer.name Broker FQDN
messaging.destination (will change) Entity name
messaging.eventhubs.consumer_group Consumer group name
messaging.eventhubs.partition_id Partition id
otel.status_code Success or failure
messaging.eventhubs.checkpoint.duration Duration of checkpoint call ms Histogram double net.peer.name Broker FQDN
messaging.destination (will change) Entity name
messaging.eventhubs.consumer_group Consumer group name
messaging.eventhubs.partition_id Partition id
otel.status_code Success or failure
messaging.eventhubs.checkpoint.sequence_number Last checkpointed sequence number {seqNo} Gauge Long net.peer.name Broker FQDN
messaging.destination (will change) Entity name
messaging.eventhubs.partition_id Partition id
messaging.eventhubs.consumer_group Consumer group name
otel.status_code Success or failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment