open-telemetry / open-telemetry/opentelemetry-java
Move validation methods to public api
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 58
Description
As discussed in https://github.com/open-telemetry/opentelemetry-java/issues/2935, we need to add our own validation.
In addition, we need to pre-check the values coming in from headers, to avoid trying to call BaggageBuilder.put with a null or empty string.
Currently the code to validate keys and values is in private static methods in ImmutableBuilder, and those in turn call methods that are in io.opentelemetry.api.internal.StringUtils, which is an internal package.
We don't want to just copy this code.
(If it's safe to call code in internal packages, let us know and that part we'll drop from this request.)
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 issue 2935, then inspect the private validation methods in ImmutableBuilder and the referenced methods in io.opentelemetry.api.internal.StringUtils. Determine how validation should be exposed through the public API and how header values are pre-checked before BaggageBuilder.put; done means both concerns no longer depend on copied validation logic or null/empty inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100