open-telemetry / open-telemetry/opentelemetry-java
Increase the log level for potential ThreadLocal leaks
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.
We've observed some ThreadLocal leaks due to the unclosed scope or close attempts in wrong order.
It makes really hard to figure out the cause when it works with opentelemetry java instrumentation because it's working as a shaded dependency and the log message level if FINE.
It's hard to implement a custom context storage when it comes with java instrumentation.
Describe the solution you'd like
I hope that it can be log the wrong attempts of closing the scope as ERROR or WARN level at least.
Describe alternatives you've considered
N?A
Additional context
N/A
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 with context/src/main/java/io/opentelemetry/context/ThreadLocalContextStorage.java at the referenced line and inspect how incorrect scope-closing attempts are currently logged. Check the existing context tests, then verify that these attempts are emitted at WARN or ERROR level and that the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100