open-telemetry / open-telemetry/opentelemetry-cpp
Header only singletons are not working properly for Windows
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 632
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 75
Description
The opentelemetry-cpp API uses header only singletons, for example for the tracer provider.
When:
- an application calls
TracerProvider::SetTracerProvider()in the main application code - a shared library is loaded by the main application
- the shared library uses
TracerProvider::GetTracerProvider()
the shared library does not see the tracer provider installed in the main application.
As a result, opentelemetry is disabled in the shared library (the noop tracer provider is seen instead).
Related issues:
- #1105
- #1932
- #1604
- This fixed all platforms except Windows.
- #2164
- The test is executed on all platforms except Windows.
- #1595
- #1525
The issue about singletons for the Windows platform is known, but still not resolved.
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 reviewing the related issues, especially #1604 and #2164, then reproduce the described Windows scenario with a main application, a loaded shared library, and the tracer provider singleton. Done means the shared library observes the provider set by the main application and the corresponding test runs on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design, observability-sre, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100