Skip to content

Header only singletons are not working properly for Windows #2534

@marcalff

Description

@marcalff

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:

The issue about singletons for the Windows platform is known, but still not resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdo-not-staletriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions