open-telemetry / open-telemetry/opentelemetry-java
Feature Request: Better support for injecting into immutable carriers
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 58
Description
Is your feature request related to a problem? Please describe.
TextMapSetter API doesn't work well with immutable Carriers. For example, SQS SendMessageRequest in the AWS Java SDK v2.
Describe the solution you'd like
Perhaps the inject() API and TextMapSetter could support returning the newly injected carrier?
Describe alternatives you've considered
Currently, my TextMapSetter for Immutable carriers put the new carrier in some kind of variable that I then aquire and actually send. This is sub-optimal because it makes my TextMapSetter, not thread-safe requiring a new instance for each injection. This isn't too bad but seems to go against the idea of the injection api.
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.
Research direction
Start by reading the TextMapSetter and inject() API definitions and their documentation. Assess how a newly injected immutable carrier could be returned without requiring mutable shared state, then define the compatibility and usage expectations before changing the API; done means immutable carriers such as AWS Java SDK v2 SendMessageRequest can be injected without a thread-unsafe workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100