Skip to content

Commit

Permalink
Add other attributes from OTEP
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Oct 19, 2022
1 parent bda721c commit bfb6c8e
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 84 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ release.
- Rename `http.retry_count` to `http.resend_count` and clarify its meaning.
([#2743](https://github.com/open-telemetry/opentelemetry-specification/pull/2743))
- BREAKING: rename `messaging.destination` to `messaging.destination.name`,
`messaging.temp_destination` to `messaging.destination.temporary`,
`messaging.destination_kind` to `messaging.destination.kind`,
`messaging.message_id` to `messaging.message.id`,
`messaging.protocol` to `net.app.protocol.name`,
`messaging.protocol_version`, `net.app.protocol.version`,
`messaging.conversation_id` to `messaging.message.conversation_id`,
`messaging.message_payload_size_bytes` to `messaging.message.payload_size_bytes`,
`messaging.message_payload_compressed_size_bytes` to `messaging.message.payload_compressed_size_bytes`,
`messaging.kafka.message_key` to `messaging.kafka.message.key`,
`messaging.rocketmq.message_type` to `messaging.rocketmq.message.type`,
`messaging.rocketmq.message_tag` to `messaging.rocketmq.message.tag`,
`messaging.rocketmq.message_keys` to `messaging.rocketmq.message.keys`.
Clarify that per-message attributes should be populated on links for batching scenarios.
`messaging.rocketmq.message_keys` to `messaging.rocketmq.message.keys`,
Split `destination` and `source` namespaces and clarify per-message attributes in batching scenarios.
([#2763](https://github.com/open-telemetry/opentelemetry-specification/pull/2763)).

### Metrics
Expand Down
12 changes: 7 additions & 5 deletions schemas/1.15.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ versions:
1.15.0:
spans:
changes:
# https://github.com/open-telemetry/opentelemetry-specification/pull/2743
- rename_attributes:
attribute_map:
# https://github.com/open-telemetry/opentelemetry-specification/pull/2743
http.retry_count: http.resend_count
# https://github.com/open-telemetry/opentelemetry-specification/pull/2763
- rename_attributes:
attribute_map:
# https://github.com/open-telemetry/opentelemetry-specification/pull/2763
messaging.protocol: net.app.protocol.name
messaging.protocol_version: net.app.protocol.version
messaging.destination: messaging.destination.name
messaging.temp_destination: messaging.destination.temporary,
messaging.destination_kind: messaging.destination.kind,
messaging.message_id: messaging.message.id
messaging.conversation_id: messaging.message.conversation_id
messaging.message_payload_size_bytes: messaging.message.payload_size_bytes
messaging.message_payload_compressed_size_bytes: messaging.message.payload_compressed_size_bytes
messaging.kafka.message_key: messaging.kafka.message.key
messaging.rocketmq.message_type: messaging.rocketmq.message.type
messaging.rocketmq.message_tag: messaging.rocketmq.message.tag
messaging.rocketmq.message_keys: messaging.rocketmq.message.keys
messaging.rocketmq.message_keys: messaging.rocketmq.message.keys
1.14.0:
1.13.0:
spans:
Expand Down
125 changes: 91 additions & 34 deletions semantic_conventions/trace/messaging.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
groups:
- id: messaging.message
prefix: messaging
# todo (https://github.com/open-telemetry/build-tools/issues/123)
type: span
brief: 'Semantic convention describing per-message attributes populated on messaging spans or links.'
attributes:
Expand All @@ -11,8 +12,18 @@ groups:
Destination name SHOULD uniquely identify specific queue, topic, or other entity within broker. If
broker does not have such notion, destination name SHOULD uniquely identify broker.
If destination name is the same for all messages being published,
it MUST be set on corresponding publish, receive, process or other span.
If destination name is the same for all messages being published,
it MUST be set on corresponding span.
examples: ['MyQueue', 'MyTopic']
- id: source.name
type: string
brief: 'The message source name'
note: |
Source name SHOULD uniquely identify specific queue, topic, or other entity within broker. If
broker does not have such notion, source name SHOULD uniquely identify broker.
If source name is the same for all messages being received or processed,
it MUST be set on corresponding span.
examples: ['MyQueue', 'MyTopic']
- id: message.id
type: string
Expand Down Expand Up @@ -47,32 +58,6 @@ groups:
requirement_level: required
brief: 'A string identifying the messaging system.'
examples: ['kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS']
- 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 sent to a topic"
requirement_level:
conditionally_required: If the message destination is either a `queue` or `topic`.
brief: 'The kind of message destination'
- id: temp_destination
type: boolean
requirement_level:
conditionally_required: If value is `true`. When missing, the value 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.'
Expand All @@ -87,12 +72,7 @@ groups:
Instrumentation SHOULD always set it on batch `receive` operations regardless
of the actual number of received messages (e.g. 0, 1, or more).
examples: [0, 1, 2]
- ref: messaging.destination.name
requirement_level:
conditionally_required: if available and if the value applies to all messages in the batch.
- ref: messaging.message.id
requirement_level:
recommended: Only if messaging.batch.size is not set or if the value applies to all messages in the batch.
- ref: messaging.message.conversation_id
requirement_level:
recommended: Only if messaging.batch.size is not set or if the value applies to all messages in the batch.
Expand All @@ -117,7 +97,9 @@ groups:
tag: connection-level
requirement_level:
recommended: If different than `net.peer.name` and if `net.sock.peer.addr` is set.

- ref: net.app.protocol.name
examples: ['AMQP', 'MQTT']
- ref: net.app.protocol.version
constraints:
- include: network

Expand All @@ -127,6 +109,47 @@ groups:
extends: messaging
span_kind: producer
brief: 'Semantic convention for producers of messages sent to a messaging systems.'
attributes:
- ref: messaging.destination.name
requirement_level:
conditionally_required: If the value applies to all messages in the batch.
- 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 sent to a topic"
requirement_level:
conditionally_required: If the message destination is either a `queue` or `topic`.
brief: 'The kind of message destination'
- id: destination.template
type: string
requirement_level:
conditionally_required: >
If available. Instrumentations MUST NOT use `messaging.destination.name` as template
unless low-cardinality of destination name is guaranteed.
brief: Low cardinality field representing messaging destination
note: >
Destination names could be constructed from templates.
An example would be a destination name involving a user name or product id.
Although the destination name in this case is of high cardinality,
the underlying template is of low cardinality and can be effectively
used for grouping and searching spans.
examples: ['/customers/{customerId}']
- id: destination.temporary
type: boolean
requirement_level:
conditionally_required: If value is `true`. When missing, the value is assumed to be `false`.
brief: 'A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed.'
- id: destination.anonymous
type: boolean
requirement_level:
conditionally_required: If value is `true`. When missing, the value is assumed to be `false`.
brief: 'A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name).'

- id: messaging.producer.synchronous
prefix: messaging
Expand Down Expand Up @@ -165,6 +188,40 @@ groups:
`messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id`
of the client consuming the message.
examples: 'mygroup - client-6'
- ref: messaging.source.name
requirement_level:
conditionally_required: If the value applies to all messages in the batch.
- id: source.kind
type:
allow_custom_values: true
members:
- id: queue
value: "queue"
brief: "A message received from a queue"
- id: topic
value: "topic"
brief: "A message received from a topic"
requirement_level:
conditionally_required: If the message source is either a `queue` or `topic`.
brief: 'The kind of message source'
- id: source.template
type: string
brief: 'Low cardinality field representing messaging source'
requirement_level:
conditionally_required: >
If available. Instrumentations MUST NOT use `messaging.source.name` as template
unless low-cardinality of source name is guaranteed.
examples: ['/customers/{customerId}']
- id: source.temporary
type: boolean
requirement_level:
recommended: when supported by messaging system and only if the source is temporary. If missing, assumed to be false.
brief: 'denotes that the source is a temporary source and might not exist anymore after messages are processed'
- id: source.anonymous
type: boolean
requirement_level:
recommended: when supported by messaging system and only if the source is anonymous. If missing, assumed to be false.
brief: 'denotes that the source is an anonymous source (could be unnamed or have auto-generated name)'

- id: messaging.consumer.synchronous
prefix: messaging
Expand Down
Loading

0 comments on commit bfb6c8e

Please sign in to comment.