Skip to content

Commit

Permalink
Attempt to use the semconv yaml format and generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
cwildman committed Oct 15, 2020
1 parent 9adc80e commit deb28ab
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 17 deletions.
55 changes: 55 additions & 0 deletions semantic_conventions/metrics/messaging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
groups:
- id: messaging
prefix: messaging
brief: >
This document defines the lables used in
messaging systems.
attributes:
- id: system
type: string
required: always
brief: 'A string identifying the messaging system.'
examples: ['kafka', 'rabbitmq', 'activemq']
- id: destination
type: string
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']
constraints:
- any_of:
- 'net.peer.name'
- 'net.peer.ip'
- 'net.peer.port'
- 'net.transport'
- include: network
21 changes: 4 additions & 17 deletions specification/metrics/semantic_conventions/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,10 @@ The [Trace Messaging Semantic Conventions Definitions](../../trace/semantic_conv

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

| Label | Description | Example | Required |
|---|---|---|---|
| `messaging.system` | A string identifying the messaging system. | `kafka`<br>`rabbitmq`<br>`activemq` | Yes |
| `messaging.destination` | The message destination name. | `MyQueue`<br>`MyTopic` | Yes |
| `messaging.destination_kind` | The kind of message destination | `queue` | Conditional [1] |
| `messaging.temp_destination` | A boolean that is true if the message destination is temporary. | true | Conditional<br>If missing, it is assumed to be false. |
| `messaging.protocol` | The name of the transport protocol. | `AMQP`<br>`MQTT` | No |
| `messaging.protocol_version` | The version of the transport protocol. | `0.9.1` | No |
| `messaging.url` | Connection string. | `tibjmsnaming://localhost:7222`<br>`https://queue.amazonaws.com/80398EXAMPLE/MyQueue` | No [2] |
| `net.peer.name` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | kafka-pool-us-east | No [2] |
| `net.peer.port` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | 9092 | No [2] |
| `net.peer.ip` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | 127.0.0.1 | No [2] |
| `net.transport` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | IP.TCP | No [2] |

**[1]:** Required only if the message destination is either a `queue` or `topic`.

**[2]** 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):
<!-- semconv messaging -->
<!-- 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):

* `messaging.url`
* `net.peer.name`, `net.peer.port`, `net.peer.ip`, `net.transport`
Expand Down

0 comments on commit deb28ab

Please sign in to comment.