Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x Global tracer not set as part of Helidon MP start-up with OpenTelemetry #9488

Closed
tjquinno opened this issue Nov 12, 2024 · 0 comments · Fixed by #9489
Closed

4.x Global tracer not set as part of Helidon MP start-up with OpenTelemetry #9488

tjquinno opened this issue Nov 12, 2024 · 0 comments · Fixed by #9489
Assignees
Labels
4.x Version 4.x bug Something isn't working MP P2 telemetry
Milestone

Comments

@tjquinno
Copy link
Member

Environment Details

  • Helidon Version: 4.x
  • Helidon SE or Helidon MP MP
  • JDK version:
  • OS:
  • Docker version (if applicable):

Problem Description

Helidon's OpenTelemetry CDI producer for tracing items (such as tracer, etc.) does not assign the Helidon global tracer soon enough.

Although injection points for the Tracer contain the correct, fully-configured tracer, an access to Tracer.global() before CDI has to produce a tracing element incorrectly returns the default (no-op) tracer.

Steps to reproduce

Add the following test to the helidon-microprofile-telemetry component:

@HelidonTest
@AddConfig(key = "otel.sdk.disabled", value = "false")
class TestTracerAtStartup {

    @Test
    void checkForFullFeaturedTracerAtStartup() {
        assertThat("Global tracer from start-up extension",
                   TestExtension.globalTracerAtStartup.unwrap(io.opentelemetry.api.trace.Tracer.class).getClass().getName(),
                   not(containsString("Default")));
    }
}

The test fails because, although the server has completed its start-up work, CDI has not created the Helidon producer app-scoped bean and that code assigns global tracer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x bug Something isn't working MP P2 telemetry
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant