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

Revamp messaging metrics to support generic operations #1006

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented May 4, 2024

Fixes #947, #937

Changes

  • deprecate messaging.operation.type
  • make messaging.operation.name required.
  • update span name accordingly (and following DB semconv pattern of {operation} {destination})
  • update metrics:
    • unify messaging.publish.duration and messaging.receive.duration in one messaging.client.operation.duration
    • rename messaging.publish.messages to messaging.client.produced.messages
    • unify messaging.receive.messages and messaging.process.messages in one messaging.client.consumed.messages
    • rename messaging.process.duration to messaging.client.process.duration

Merge requirement checklist

@lmolkova lmolkova force-pushed the messaging-revamp-metrics branch 2 times, most recently from 4511bc0 to 86ee3c9 Compare May 4, 2024 05:14
@lmolkova lmolkova marked this pull request as ready for review May 8, 2024 05:01
@lmolkova lmolkova requested review from a team as code owners May 8, 2024 05:01
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.

Thanks @lmolkova, I think this is going in a good direction.

docs/attributes-registry/messaging.md Outdated Show resolved Hide resolved
docs/messaging/messaging-metrics.md Outdated Show resolved Hide resolved
docs/messaging/messaging-metrics.md Outdated Show resolved Hide resolved
docs/messaging/messaging-metrics.md Outdated Show resolved Hide resolved
.chloggen/1006.yaml Outdated Show resolved Hide resolved
.chloggen/1006.yaml Outdated Show resolved Hide resolved
model/trace/messaging.yaml Outdated Show resolved Hide resolved
model/trace/messaging.yaml Outdated Show resolved Hide resolved
docs/messaging/messaging-spans.md Outdated Show resolved Hide resolved
docs/messaging/messaging-metrics.md Outdated Show resolved Hide resolved
docs/messaging/messaging-spans.md Outdated Show resolved Hide resolved
docs/messaging/messaging-spans.md Outdated Show resolved Hide resolved
schema-next.yaml Outdated Show resolved Hide resolved
@lmolkova lmolkova force-pushed the messaging-revamp-metrics branch 2 times, most recently from 4010ef2 to 203ebb3 Compare May 30, 2024 01:57
@lmolkova lmolkova force-pushed the messaging-revamp-metrics branch 5 times, most recently from 1b78dd5 to 69bfd72 Compare May 30, 2024 22:07
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.

Thanks a lot @lmolkova, it feels we're getting quite close!

docs/messaging/messaging-metrics.md Show resolved Hide resolved
docs/messaging/messaging-metrics.md Outdated Show resolved Hide resolved
model/metrics/messaging-metrics.yaml Show resolved Hide resolved
docs/messaging/messaging-spans.md Outdated Show resolved Hide resolved
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 have some smaller remarks, but nothing that should block merging this. I'm looking forward to first prototypes based on these changes.

docs/messaging/messaging-spans.md Outdated Show resolved Hide resolved
docs/messaging/messaging-spans.md Outdated Show resolved Hide resolved
docs/messaging/messaging-spans.md Show resolved Hide resolved
docs/messaging/messaging-spans.md Show resolved Hide resolved
.chloggen/1006.yaml Show resolved Hide resolved
@trask
Copy link
Member

trask commented Jun 7, 2024

  • deprecate messaging.operation.type

and

  • unify ... in one messaging.client.operation.duration

looks like drift on this parts of PR description

# durations
- id: metric.messaging.client.request.duration
type: metric
metric_name: messaging.client.request.duration
Copy link
Member

Choose a reason for hiding this comment

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

naming it "request" seems like a good choice over "operation" in order to help mitigate the confusion around whether this also includes "process" times (which have "messaging.operation.name" and so seem like they should be included in anything called "operation")

Comment on lines +72 to +73
The metric MUST be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, the number of received messages
is reported when then message is received and not reported for the processing operation.
Copy link
Member

Choose a reason for hiding this comment

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

maybe MUST -> SHOULD?

this could be tricky to implement / coordinate, e.g. when we instrument Spring messaging to capture "process" operations, and Spring uses Kafka polling under the hood which is also instrumented to capture "receive" operation

metric_name: messaging.client.published.messages
brief: "Number of messages producer attempted to publish to the broker."
note: >
This metric MUST NOT count messages that were created, but aren't being published yet.
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
This metric MUST NOT count messages that were created, but aren't being published yet.
This metric MUST NOT count messages that were created but haven't been published yet.

metric_name: messaging.client.request.duration
brief: "Duration of messaging operation initiated by a producer or consumer."
note: >
This metric SHOULD NOT be used to report processing duration - processing duration is reported in `messaging.process.duration` metric.
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
This metric SHOULD NOT be used to report processing duration - processing duration is reported in `messaging.process.duration` metric.
This metric SHOULD NOT be used to report processing duration - processing duration is reported in `messaging.client.process.duration` metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs More Approval
Development

Successfully merging this pull request may close these issues.

Messaging.operation.type attribute should not be required
4 participants