Repository navigation
Conversation
Pull request dashboard statusWaiting on reviewers · refreshed 2026-10-21 02:45 UTC Review the latest changes. Status above doesn't look right?
|
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add annotation implementation from PR #20775
Restrict span annotations to methods
Oct 20, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused annotation-contract change preserves method coverage and has no blocking findings.
1 open issue
What changed in this PR
Restricts the span annotations to methods for the 3.0 API cleanup, without changing method instrumentation.
Changes:
- Updates annotation targets and Javadoc.
- Replaces constructor tests and fixtures with method-only target assertions.
- Documents the source-breaking change.
| File | Description |
|---|---|
| instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/test/java/io/opentelemetry/test/annotation/WithSpanInstrumentationTest.java | Asserts method-only targeting. |
| instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/test/java/io/opentelemetry/test/annotation/TracedWithSpan.java | Removes annotated constructor fixture. |
| instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/test/java/io/opentelemetry/test/annotation/ConstructorOnlyAddingSpanAttributes.java | Deletes constructor-only fixture. |
| instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/test/java/io/opentelemetry/test/annotation/ConstructedWithAddingSpanAttributes.java | Deletes mixed constructor/method fixture. |
| instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/test/java/io/opentelemetry/test/annotation/AddingSpanAttributesInstrumentationTest.java | Replaces constructor tests with target assertion. |
| instrumentation-annotations/src/main/java/io/opentelemetry/instrumentation/annotations/WithSpan.java | Restricts target and updates Javadoc. |
| instrumentation-annotations/src/main/java/io/opentelemetry/instrumentation/annotations/AddingSpanAttributes.java | Restricts target and updates Javadoc. |
| CHANGELOG.md | Records the annotation API breaking change. |
Review effort: Balanced
Clarify breaking changes in opentelemetry-instrumentation-annotations. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
trask
reviewed
Oct 20, 2026
trask
marked this pull request as ready for review
October 20, 2026 21:54
trask
approved these changes
Oct 20, 2026
Record the method-only annotation targets in the generated API comparison so the build's committed-report check stays current. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Annotation-only replacement for #20775, independent of its messaging changes. Completes the 3.0 source-contract cleanup:
@WithSpanand@AddingSpanAttributestarget methods only; method instrumentation is unchanged.Remove either annotation from constructors:
ElementType.METHODand update Javadoc.