open-telemetry / open-telemetry/opentelemetry-java-instrumentation
Remove deprecated code in 3.0
@trask is already working on this.
Since Jun 11, 2026.
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 1.2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 228
Description
Context
There are a number of deprecated APIs / compatibility shims in the repo that are already annotated with comments like:
@Deprecated // to be removed in 3.0@Deprecated // will be removed in 3.0.0- Javadoc text such as
Will be removed in 3.0
Issue #15806 is one example of this pattern (IgnoredTypesConfigurer#configure(IgnoredTypesBuilder, ConfigProperties)).
There is also a second, related marker for APIs that are renamed rather than removed in 3.0:
// will be renamed in 3.0 to <name>()
These are transitional names taken by a new API that had to coexist with a legacy one it could not be distinguished from by overloading. Once the legacy method is deleted, the transitional name collapses back to the plain name.
Goal
Before / during the 3.0 work, remove the APIs and compatibility code that are already explicitly marked for removal in 3.0, and collapse the transitional names back to their plain form.
Suggested approach
Use the existing comments as the source of truth and audit all matches. The two passes are ordered: a rename is only possible once the removal pass has freed up the target name.
# pass 1 - removals
git grep -n "will be removed in 3.0.0\|to be removed in 3.0\|Will be removed in 3.0.0\|Will be removed in 3.0"
# pass 2 - renames (only after pass 1 frees up the target names)
git grep -n "will be renamed in 3.0"
Then remove the marked APIs / shims and any now-unneeded compatibility code, tests, and docs, and apply the renames.
Notes
-
Some matches are public API deprecations.
-
Some matches are internal compatibility paths or temporary annotations/comments.
-
The audit should confirm each remaining match is still intended for 3.0 removal.
-
The messaging v1.43 stack (#19347-#19357) introduces two renames:
transitional name (2.x) 3.0 name MessagingProducerMetrics.getForOperationTypegetMessagingConsumerMetrics.getForOperationTypegetBoth are blocked behind pass 1, which removes the deprecated
get()overloads currently holding
those names.MessagingProducerMetrics.getForOperationTypeWithOldMetricsand
MessagingConsumerMetrics.getForOperationTypeWithOldMetricsare marked// to be removed in 3.0
and so are handled by pass 1 as well, not by the rename pass.The extractors need no rename.
MessagingAttributesExtractor.create/builder,
MessagingSpanNameExtractor.create/builderandMessagingSpanKindExtractor.createare each
overloaded onMessagingOperationTypeversus the deprecatedMessageOperation, so deleting the
latter in pass 1 is enough. An earlier revision of the stack gaveMessagingAttributesExtractor
distinct*ForOperationTypenames to avoid anull-literal ambiguity between its two overloads;
that was replaced by plain overloads, so only the two metrics accessors above still carry a
// will be renamed in 3.0 to get()marker.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.