Skip to content

Add messaging v1.43 shared metrics#19267

Draft
trask wants to merge 2 commits into
open-telemetry:mainfrom
trask:messaging-v1-43-metrics
Draft

Add messaging v1.43 shared metrics#19267
trask wants to merge 2 commits into
open-telemetry:mainfrom
trask:messaging-v1-43-metrics

Conversation

@trask

@trask trask commented Jul 19, 2026

Copy link
Copy Markdown
Member

Depends on #19266.

Dependency baseline: 653c0b1d622f3fb3b9be44a0c205d3d37dcd2214.
Review only: 653c0b1d622f3fb3b9be44a0c205d3d37dcd2214..71cd7a78a22054d7e337169311c2d60c48b52c6d.

Exactly one shared-metrics commit. Typed metrics gate instruments by operation type and suppress non-positive updates; stable advice follows the pinned v1.43 metric model.

Validated: complete producer/consumer suites in default/stable/dual modes plus Spotless.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 19, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-22 16:49:29 UTC.

  • Waiting on: Author
  • Next step: Move out of draft to request review.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds shared v1.43 messaging metrics behind semantic-convention selection while preserving legacy and dual-emission modes.

Changes:

  • Adds current producer, consumer, and processing metrics.
  • Filters high-cardinality destination names and applies metric attribute advice.
  • Tests batch counts, failures, filtering, and selection modes.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.

Show a summary per file
File Description
MessagingConsumerMetrics.java Adds current consumer metrics and batch-aware counting.
MessagingMetricsAdvice.java Defines attribute advice and destination filtering.
MessagingProcessMetrics.java Adds processing-duration metrics.
MessagingProducerMetrics.java Adds current producer metrics and selection logic.
MessagingConsumerMetricsTest.java Tests consumer metrics across modes.
MessagingMetricsAdviceTest.java Tests high-cardinality filtering.
MessagingProcessMetricsTest.java Tests processing-duration emission.
MessagingProducerMetricsTest.java Tests producer metrics across modes.

@trask
trask force-pushed the messaging-v1-43-metrics branch from 3bb0980 to 2577c18 Compare July 19, 2026 20:15
@trask
trask requested a review from Copilot July 19, 2026 20:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.

@trask
trask force-pushed the messaging-v1-43-metrics branch from 2577c18 to cc2702c Compare July 21, 2026 01:51
@trask
trask requested a review from Copilot July 21, 2026 02:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.

@trask
trask force-pushed the messaging-v1-43-metrics branch from 3f84ab9 to 1ee151a Compare July 21, 2026 02:29
@trask
trask requested a review from Copilot July 21, 2026 02:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

@trask
trask force-pushed the messaging-v1-43-metrics branch from 1e0eb17 to d547025 Compare July 21, 2026 02:46
@trask
trask requested a review from Copilot July 21, 2026 02:47
@trask
trask force-pushed the messaging-v1-43-metrics branch from e2cb4ee to 9351d08 Compare July 21, 2026 04:07
@trask
trask requested a review from Copilot July 21, 2026 04:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingProducerMetrics.java:54

  • [General] The typed entry point also supports CREATE, but in default and dual mode emitOldSemconv is true, so this legacy histogram is built and then unconditionally records messaging.publish.duration for message creation. No publish/send occurred, and the new CREATE test only checks the stable instruments, so this incorrect legacy point is currently accepted. Gate legacy publish-duration recording to the publish/SEND operation for typed listeners while preserving the unconditional behavior of legacy get(), and assert its absence for CREATE in default/dual mode.
    publishDurationHistogram = emitOldSemconv ? buildPublishDuration(meter) : null;

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingConsumerMetrics.java:98

  • [General] For typed PROCESS and SETTLE operations in default or dual mode, the legacy instruments are enabled and this unconditional path records messaging.receive.duration; the analogous unconditional counter path also records messaging.receive.messages. These operations did not receive messages, and the parameterized test only filters the stable metric names, so the bogus legacy points go unnoticed. Gate both legacy receive instruments to RECEIVE for typed listeners while retaining legacy get() behavior, and verify that PROCESS/SETTLE produce no messaging.receive.* metrics.
    if (receiveDurationHistogram != null) {
      receiveDurationHistogram.record(duration, attributes, context);
    }

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.

@trask
trask force-pushed the messaging-v1-43-metrics branch from 7c21537 to 3e64403 Compare July 21, 2026 05:03
@trask
trask requested a review from Copilot July 21, 2026 05:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

@trask
trask force-pushed the messaging-v1-43-metrics branch from 3e64403 to 7d5ee42 Compare July 21, 2026 05:14
@trask
trask requested a review from Copilot July 21, 2026 05:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

@trask
trask force-pushed the messaging-v1-43-metrics branch from 7d5ee42 to 25afce5 Compare July 21, 2026 05:35
@trask
trask requested a review from Copilot July 21, 2026 06:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingConsumerMetrics.java:150

  • [General] Suppress non-positive legacy receive updates for typed listeners too. In default and dual modes, getForOperationType() reaches this branch and calls add(0, ...) for a zero-sized batch (creating an empty series), while a negative update is invalid for a monotonic counter. This is the remaining typed counter path that bypasses the PR's non-positive guard; preserve the legacy get() behavior if needed, but skip these updates for typed listeners.
    if (receiveMessageCount != null && recordsLegacyReceive) {
      receiveMessageCount.add(
          batchMessageCount == null ? 1 : batchMessageCount, attributes, context);

@trask
trask force-pushed the messaging-v1-43-metrics branch from 25afce5 to eca7771 Compare July 21, 2026 06:37
@trask
trask requested a review from Copilot July 21, 2026 06:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

@trask
trask force-pushed the messaging-v1-43-metrics branch from eca7771 to 71cd7a7 Compare July 21, 2026 07:01
@trask
trask requested a review from Copilot July 21, 2026 07:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants