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

Refactor messaging attributes and per-message attributes in batching scenarios #2763

Closed

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Aug 30, 2022

Messaging instrumentation SIG is working on spec changes and this change is one of the first steps to bring the consensus we reached in SIG to the spec.

This change clarifies that per-message attributes should be set on links when the corresponding span represents a batching operation. It introduced breaking changes (attribute renames)

  • messaging.message_id to messaging.message.id
  • 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.

Going forward, we'd like to reserve messaging.message. namespace for other possible per-message attributes.

It also adds the messaging.batch_size attribute which intends to:

  • denote a bathing operation
  • record number of messages sent/received/processed - since links can be dropped or there can be some other links not describing messages, link count is not a reliable indicator of batch size. Assuming a high-scale scenario, users might want to opt-out from per-message tracing, but then batch_size would still be useful

@lmolkova lmolkova force-pushed the messaging-batching-attributes branch from e2b201f to 29fa0b6 Compare August 30, 2022 22:08
Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

Thank you @lmolkova

semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
@reyang reyang added semconv:messaging area:semantic-conventions Related to semantic conventions labels Sep 2, 2022
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 27, 2022
@joaopgrassi
Copy link
Member

Not stale

@github-actions github-actions bot removed the Stale label Sep 28, 2022
semantic_conventions/trace/messaging.yaml Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
semantic_conventions/trace/messaging.yaml Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Oct 7, 2022

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 7, 2022
@joaopgrassi
Copy link
Member

Not stale

@github-actions github-actions bot removed the Stale label Oct 9, 2022
@lmolkova lmolkova force-pushed the messaging-batching-attributes branch from 6cf659b to bfb6c8e Compare October 19, 2022 22:49
@lmolkova lmolkova changed the title Clarify per-message attributes usage in batching scenarios Refactor messaging attributes and per-message attributes in batching scenarios Oct 19, 2022
@lmolkova lmolkova force-pushed the messaging-batching-attributes branch 4 times, most recently from 637a5d0 to 98eca80 Compare October 26, 2022 19:12
Copy link
Contributor

@brunobat brunobat left a comment

Choose a reason for hiding this comment

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

I think we can move forward to formal review.

@lmolkova lmolkova force-pushed the messaging-batching-attributes branch 2 times, most recently from 25f5759 to ceaff1b Compare November 3, 2022 16:18
Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

Thank you @lmolkova

specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
specification/trace/semantic_conventions/messaging.md Outdated Show resolved Hide resolved
Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

Thank you so much @lmolkova for putting this up and for the great discussions.
All my previous comments are resolved.

I added a few minor non-blocking suggestions.

Comment on lines +346 to +350
* message-specific under `messaging.{system}.message`
* destination-specific under `messaging.{system}.destination`
* source-specific under `messaging.{system}.source`
Copy link
Member

Choose a reason for hiding this comment

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

For completeness and consistency, and also since I think these cases exist, I want to suggest also adding messaging.{system}.batch to this list


<!-- semconv messaging.rabbitmq -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `messaging.rabbitmq.routing_key` | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. |
| `messaging.rabbitmq.message.routing_key` | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. |
Copy link
Member

Choose a reason for hiding this comment

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

Should this be messaging.rabbitmq.**destination**.routing_key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Per Rabbit docs, routing key is a message property. It's also available on consumers

@blumamir
Copy link
Member

Also, I support moving this PR out of draft and asking for reviews from the community so we can progress towards merging this.

Copy link
Contributor

@pyohannes pyohannes left a comment

Choose a reason for hiding this comment

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

I think this is ready for some wider discussion. We should open an issue, and if it's accepted, open a new clean PR based on this draft.

@lmolkova lmolkova force-pushed the messaging-batching-attributes branch from 9c0160e to 54c07c3 Compare November 16, 2022 20:01
@lmolkova
Copy link
Contributor Author

lmolkova commented Nov 16, 2022

Thanks everyone for the review! Per discussion at the last SIG meeting, I'm going to close this one and open a new PR - #2957 (to simplify final review process).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions semconv:messaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants