Skip to content

Commit

Permalink
Use references for metrics-messaging labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
cwildman committed Oct 15, 2020
1 parent 03cb521 commit 8c0d5b2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 57 deletions.
67 changes: 11 additions & 56 deletions semantic_conventions/metrics/messaging.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,21 @@
groups:
- id: messaging
- id: metrics-messaging
prefix: messaging
brief: >
This document defines the lables used in
messaging systems.
This document defines the attributes used in
messaging system metrics.
attributes:
- id: system
type: string
- ref: messaging.system
required: always
brief: 'A string identifying the messaging system.'
examples: ['kafka', 'rabbitmq', 'activemq']
- id: destination
type: string
- ref: messaging.destination
required: always
brief: >
The message destination name.
examples: ['MyQueue', 'MyTopic']
- id: destination_kind
type:
allow_custom_values: false
members:
- id: queue
value: "queue"
brief: "A message sent to a queue"
- id: topic
value: "topic"
brief: "A message broadcast to the subscribers of the topic"
required:
conditional: 'Required only if the message destination is either a `queue` or `topic`.'
brief: 'The kind of message destination'
- id: temp_destination
type: boolean
required:
conditional: 'If missing, it is assumed to be false.'
brief: 'A boolean that is true if the message destination is temporary.'
- id: protocol
type: string
brief: 'The name of the transport protocol.'
examples: ['AMQP', 'MQTT']
- id: protocol_version
type: string
brief: 'The version of the transport protocol.'
examples: '0.9.1'
- id: url
type: string
brief: 'Connection string.'
examples: ['tibjmsnaming://localhost:7222', 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue']
- ref: messaging.destination_kind
required: always
- ref: messaging.temp_destination
- ref: messaging.protocol
- ref: messaging.protocol_version
- ref: messaging.url
- ref: net.peer.name
note: >
This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from.
required:
conditional: If available.
- ref: net.peer.ip
tag: connection-level
required:
conditional: If available.
- ref: net.peer.port
tag: connection-level
required:
conditional: If available.
- ref: net.transport
tag: connection-level
brief: 'Transport protocol used.'
required:
conditional: If available.
15 changes: 14 additions & 1 deletion specification/metrics/semantic_conventions/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ The [Trace Messaging Semantic Conventions Definitions](../../trace/semantic_conv

The following labels **SHOULD** be applied to all messaging metric instruments.

<!-- semconv messaging -->
<!-- semconv metrics-messaging -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `messaging.destination` | string | The message destination name. This might be equal to the span name but is required nevertheless. | `MyQueue`<br>`MyTopic` | Yes |
| `messaging.destination_kind` | string enum | The kind of message destination | `queue` | Yes |
| `messaging.protocol` | string | The name of the transport protocol. | `AMQP`<br>`MQTT` | No |
| `messaging.protocol_version` | string | The version of the transport protocol. | `0.9.1` | No |
| `messaging.system` | string | A string identifying the messaging system. | `kafka`<br>`rabbitmq`<br>`activemq` | Yes |
| `messaging.temp_destination` | boolean | A boolean that is true if the message destination is temporary. | | No |
| `messaging.url` | string | Connection string. | `tibjmsnaming://localhost:7222`<br>`https://queue.amazonaws.com/80398EXAMPLE/MyQueue` | No |
| `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | No |
| `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | No |
| `net.peer.port` | number | Remote port number. | `80`<br>`8080`<br>`443` | No |
| `net.transport` | string enum | Transport protocol used. See note below. | `IP.TCP` | No |
<!-- endsemconv -->

For messaging metric labels, one of the following sets of labels is RECOMMENDED (in order of usual preference unless for a particular messaging system it is known that some other set is preferable for some reason; all strings must be non-empty):
Expand Down

0 comments on commit 8c0d5b2

Please sign in to comment.