Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messaging: remove source to better align with ECS #3450

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ release.
([#3390](https://github.com/open-telemetry/opentelemetry-specification/pull/3390))
- BREAKING: Remove `messaging.consumer.id`, make `messaging.client_id` generic
([#3336](https://github.com/open-telemetry/opentelemetry-specification/pull/3336))
- BREAKING: Remove `messaging.source.*` attributes and use `messaging.destination.*`
attributes on producer and consumer to describe messaging queue or topic.
([#3450](https://github.com/open-telemetry/opentelemetry-specification/pull/3450))

### Compatibility

Expand Down
7 changes: 7 additions & 0 deletions schemas/1.21.0
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ versions:
attribute_map:
messaging.kafka.client_id: messaging.client_id
messaging.rocketmq.client_id: messaging.client_id
# https://github.com/open-telemetry/opentelemetry-specification/pull/3450
- rename_attributes:
attribute_map:
messaging.source.name: messaging.destination.name
messaging.source.template: messaging.destination.template
messaging.source.temporary: messaging.destination.temporary
messaging.source.anonymous: messaging.destination.anonymous
Comment on lines +15 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a nit, but I wonder what the desired outcome would be in case both messaging.source.* and messaging.destination.* attributes were specified on consumer side.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will remove these from here right? From what I remember from our last SIG meeting.

1.20.0:
spans:
changes:
Expand Down
122 changes: 41 additions & 81 deletions semantic_conventions/trace/messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ groups:
brief: 'Semantic convention describing per-message attributes populated on messaging spans or links.'
attributes:
- ref: messaging.destination.name
- ref: messaging.source.name
- ref: messaging.destination_original.name
- id: message.id
type: string
brief: 'A value used by the messaging system as an identifier for the message, represented as a string.'
Expand All @@ -31,6 +31,10 @@ groups:
prefix: messaging.destination
type: attribute_group
brief: 'Semantic convention for attributes that describe messaging destination on broker'
note: >
Destination attributes SHOULD be set on publish, receive, or other span describing messaging messaging operation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Destination attributes SHOULD be set on publish, receive, or other span describing messaging messaging operation
Destination attributes SHOULD be set on publish, receive, or other spans describing messaging operations.

if it operates with single message or if the attribute value applies to all messages in the batch.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if it operates with single message or if the attribute value applies to all messages in the batch.
Destination attributes should be set when the messaging operation handles single messages. When the operation handles a batch of messages, the destination attributes should only be applied when the attribute value applies to all messages in the batch.

I feel this sentence was "merged" together with the above, so it was a bit confusing. I tried separating then so they can be read completely separately.

I'm not sure about the should here, so I left it non-normative.

In other cases, destination attributes MAY be set on links.
attributes:
- id: name
type: string
Expand All @@ -56,34 +60,40 @@ groups:
type: boolean
brief: 'A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name).'

- id: messaging.source
prefix: messaging.source
- id: messaging.destination_original
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, for some reason I thought we would just get rid of the "source" concept entirely and not just rename it. Don't we need then to change the schema file to redirect to messaging.destination_original then?

prefix: messaging.destination_original
type: attribute_group
brief: 'Semantic convention for attributes that describe messaging source on broker'
brief: >
Semantic convention for attributes that describe destination messages were originally published to.
These attributes should be used on the consumer side when original destination is available and different than destination message are consumed from.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could add some clarification the "original destination" refers to the destination the message was originally published to?


Original destination attributes SHOULD be set on publish, receive, or other span describing messaging messaging operation
if it operates with single message or if the attribute value applies to all messages in the batch.
In other cases, destination attributes MAY be set on links.
attributes:
- id: name
type: string
brief: 'The message source name'
brief: 'The original destination name'
note: |
Source name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If
the broker does not have such notion, the source name SHOULD uniquely identify the broker.
The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If
the broker does not have such notion, the original destination name SHOULD uniquely identify the broker.
examples: ['MyQueue', 'MyTopic']
- id: template
type: string
brief: 'Low cardinality representation of the messaging source name'
brief: 'Low cardinality representation of the original messaging destination name'
examples: ['/customers/{customerId}']
note: >
Source names could be constructed from templates.
An example would be a source name involving a user name or product id.
Although the source name in this case is of high cardinality,
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 aggregation.
- id: temporary
type: boolean
brief: 'A boolean that is true if the message source is temporary and might not exist anymore after messages are processed.'
brief: 'A boolean that is true if the original message destination is temporary and might not exist anymore after messages are processed.'
- id: anonymous
type: boolean
brief: 'A boolean that is true if the message source is anonymous (could be unnamed or have auto-generated name).'
brief: 'A boolean that is true if the original message destination is anonymous (could be unnamed or have auto-generated name).'

- id: messaging
prefix: messaging
Expand Down Expand Up @@ -129,6 +139,20 @@ groups:
brief: >
A unique identifier for the client that consumes or produces a message.
examples: ['client-5', 'myhost@8742@s8083jm']
- ref: messaging.destination.name
requirement_level:
conditionally_required: If span describes operation on a single message or if the value applies to all messages in the batch.
- ref: messaging.destination.template
requirement_level:
conditionally_required: >
If available. Instrumentations MUST NOT use `messaging.destination.name` as template
unless low-cardinality of destination name is guaranteed.
- ref: messaging.destination.temporary
requirement_level:
conditionally_required: If value is `true`. When missing, the value is assumed to be `false`.
- ref: messaging.destination.anonymous
requirement_level:
conditionally_required: If value is `true`. When missing, the value is assumed to be `false`.
- ref: messaging.message.id
requirement_level:
recommended: Only for spans that represent an operation on a single message.
Expand Down Expand Up @@ -160,76 +184,17 @@ groups:
examples: ['amqp', 'mqtt']
- ref: net.protocol.version

- id: messaging.producer
prefix: messaging
type: span
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 one message is being published or if the value applies to all messages in the batch.
- ref: messaging.destination.template
requirement_level:
conditionally_required: >
If available. Instrumentations MUST NOT use `messaging.destination.name` as template
unless low-cardinality of destination name is guaranteed.
- ref: messaging.destination.temporary
requirement_level:
conditionally_required: If value is `true`. When missing, the value is assumed to be `false`.
- ref: messaging.destination.anonymous
requirement_level:
conditionally_required: If value is `true`. When missing, the value is assumed to be `false`.

- id: messaging.producer.synchronous
prefix: messaging
type: span
extends: messaging
span_kind: client
brief: >
Semantic convention for clients of messaging systems that produce messages
and synchronously wait for responses.

- id: messaging.consumer
prefix: messaging
type: span
extends: messaging
span_kind: consumer
brief: 'Semantic convention for a consumer of messages received from a messaging system'
attributes:
- ref: messaging.source.name
requirement_level:
conditionally_required: If the value applies to all messages in the batch.
- ref: messaging.source.template
requirement_level:
conditionally_required: >
If available. Instrumentations MUST NOT use `messaging.source.name` as template
unless low-cardinality of source name is guaranteed.
- ref: messaging.source.temporary
requirement_level:
recommended: When supported by messaging system and only if the source is temporary. When missing, the value is assumed to be `false`.
- ref: messaging.source.anonymous
requirement_level:
recommended: When supported by messaging system and only if the source is anonymous. When missing, the value is assumed to be `false`.
- ref: messaging.destination.name
requirement_level:
recommended: If known on consumer
- ref: messaging.destination.temporary
requirement_level:
recommended: If known on consumer
- ref: messaging.destination.anonymous
requirement_level:
recommended: If known on consumer

- id: messaging.consumer.synchronous
prefix: messaging
type: span
extends: messaging.consumer
span_kind: server
brief: >
Semantic convention for servers that consume messages received from messaging systems
and always send back replies directed to the producers of these messages.
- ref: messaging.destination_original.name
- ref: messaging.destination_original.template
- ref: messaging.destination_original.temporary
- ref: messaging.destination_original.anonymous

- id: messaging.rabbitmq
prefix: messaging.rabbitmq
Expand Down Expand Up @@ -274,11 +239,6 @@ groups:
brief: >
Partition the message is sent to.
examples: 2
- id: source.partition
type: int
brief: >
Partition the message is received from.
examples: 2
- id: message.offset
type: int
brief: >
Expand Down
Loading