Skip to content

Require messaging header-name getters - #20786

Merged
laurit merged 4 commits into
mainfrom
copilot/copilot18903-implement-deliverable-again
Oct 21, 2026
Merged

laurit merged 4 commits into
mainfrom
copilot/copilot18903-implement-deliverable-again

Conversation

Copilot AI commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Messaging-only replacement for #20775, independent of the annotation changes. Makes MessagingAttributesGetter.getMessageHeaderNames abstract.

Custom getters must return supported header names or an empty iterable when none are supported. Use a snapshot for mutable carriers:

@Override
public Iterable<String> getMessageHeaderNames(Request request) {
  return new ArrayList<>(request.headers().keySet());
}
  • Carrier support: Add Camel incoming-header and Lambda SQS message-attribute getters; batch SQS events return no header names.
  • Selector compatibility: Preserve direct exact-name lookup without enumeration or normalization, plus wildcard and exclude-only matching.
  • Migration: Record the custom-getter source break under non-stable API breaking changes.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-21 07:54 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Split original PR into messaging-only component Require messaging header-name getters Oct 20, 2026
Copilot AI requested a review from trask October 20, 2026 21:36
@trask
trask requested a balanced review from Copilot October 20, 2026 21:41

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.

🟢 Approval recommended

The scoped contract change, carrier implementations, regression tests, and migration documentation are consistent, with no unresolved findings.

No open issues 🎉

What changed in this PR

Requires explicit messaging header-name enumeration in the incubator API, with Camel and Lambda SQS implementations.

Changes:

  • Makes getMessageHeaderNames mandatory and documents the alpha API source break.
  • Adds carrier-specific header access and snapshots of header names.
  • Strengthens tests for selectors, exact-name lookup, and empty headers.
File Description
instrumentation/​camel-2.20/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​camel/​v2_20/​CamelMessagingAttributesGetter.java Adds incoming-header access and enumeration.
instrumentation/​camel-2.20/​javaagent-unit-tests/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​camel/​v2_20/​CamelMessagingAttributesGetterTest.java Tests headers, snapshots, and selectors.
instrumentation/​aws-lambda/​aws-lambda-events-common-2.2/​library/​src/​test/​java/​io/​opentelemetry/​instrumentation/​awslambdaevents/​common/​v2_2/​internal/​SqsMessageAttributesGetterTest.java Tests SQS attributes and empty carriers.
instrumentation/​aws-lambda/​aws-lambda-events-common-2.2/​library/​src/​main/​java/​io/​opentelemetry/​instrumentation/​awslambdaevents/​common/​v2_2/​internal/​SqsMessageAttributesGetter.java Adds message-attribute lookup and enumeration.
instrumentation/​aws-lambda/​aws-lambda-events-common-2.2/​library/​src/​main/​java/​io/​opentelemetry/​instrumentation/​awslambdaevents/​common/​v2_2/​internal/​SqsEventAttributesGetter.java Returns no header names for batches.
instrumentation-api-incubator/​src/​test/​java/​io/​opentelemetry/​instrumentation/​api/​incubator/​semconv/​messaging/​MessagingHeadersTest.java Strengthens selector compatibility tests.
instrumentation-api-incubator/​src/​test/​java/​io/​opentelemetry/​instrumentation/​api/​incubator/​semconv/​messaging/​MessagingAttributesExtractorTest.java Updates the test getter contract.
instrumentation-api-incubator/​src/​main/​java/​io/​opentelemetry/​instrumentation/​api/​incubator/​semconv/​messaging/​MessagingAttributesGetter.java Removes the default enumeration implementation.
CHANGELOG.md Documents the custom-getter migration.

Review effort: Balanced

Comment thread CHANGELOG.md Outdated
@trask
trask marked this pull request as ready for review October 20, 2026 21:59
@trask
trask requested a review from a team as a code owner October 20, 2026 21:59

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.

🟢 Approval recommended

The focused API change includes matching implementations, compatibility coverage, and migration documentation, with no unresolved findings.

No open issues 🎉

Review effort: Balanced

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.

🟢 Approval recommended

The documented contract change, carrier implementations, and regression coverage are consistent, with no unresolved blocking issues.

No open issues 🎉

Review effort: Balanced

@laurit
laurit merged commit 571ac17 into main Oct 21, 2026
70 checks passed
@laurit
laurit deleted the copilot/copilot18903-implement-deliverable-again branch October 21, 2026 07:53
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.

4 participants