Deprecate TextMapGetter keys method#8531
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8531 +/- ##
=========================================
Coverage 90.94% 90.94%
- Complexity 10210 10211 +1
=========================================
Files 1013 1013
Lines 27175 27176 +1
Branches 3184 3184
=========================================
+ Hits 24714 24715 +1
Misses 1734 1734
Partials 727 727 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Added |
@jack-berg I've converted it to a draft. |
|
From the spec discussion: open-telemetry/opentelemetry-specification#5150 (comment)
So until the spec discussion is settled, can the |
jkwatson
left a comment
There was a problem hiding this comment.
I have no opinion one way or another on this one. I understand the appeal of being able to make this a functional interface, but it seems not good to have an empty iterable be the default, as that could end up being confusing for consumers. I'm fine with this either way.
Description
Deprecates
TextMapGetter.keys()and gives it a default empty implementation soTextMapGettercan be used as a functional interface.This lets callers implement
TextMapGetterwith a lambda when onlyget()behavior is needed, while preserving existing carrier-key enumeration behavior for implementations that overridekeys().Changes
TextMapGetteras@FunctionalInterface.TextMapGetter.keys().keys()implementation returning an empty iterable.TextMapGetterimplementation.keys()usage in deprecated Jaeger and OT trace baggage extraction paths.opentelemetry-contextAPI diff.Testing
./gradlew :context:test --tests io.opentelemetry.context.propagation.TextMapGetterTest./gradlew :extensions:trace-propagators:compileJava./gradlew :context:jApiCmp./gradlew :context:spotlessApply :extensions:trace-propagators:spotlessApplygit diff --checkFixes #8470 and dependent on spec:5177