-
Notifications
You must be signed in to change notification settings - Fork 849
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
GlobalOpenTelemetry.get and set Conflict Causing Runtime Exception in OpenTelemetry SDK #6937
Comments
@jkwatson I think there's a possible race condition.
@breedx-splk do you know of any instances in the android setup process where the autoconfigured SdkLoggerProvider might be used to emit logs (or events) before GlobalOpenTelemetry.set is called? |
I don't know of an instance like that right now, but it sounds like @celikrecep might not be using We do have a scenario where we need to emit events during library initialization, before the otel sdk has been created...and in those cases we have to go through some pains to buffer/store those in a separate model before we can actually emit them with otel. |
yes, i'm just using api+sdk, i'm not not using |
Hello, I am using OpenTelemetry version 1.44.0 in my Android project. On Crashlytics, I see the following error: "GlobalOpenTelemetry.set". This error doesn’t happen all the time but occurs for some users. The root cause of the error is as follows:
Prior to this, the stack trace points to the Dagger module where I provide OpenTelemetry, as follows:
I provide OpenTelemetry using Dagger Hilt with the following code:
Afterward, I perform all operations through this OpenTelemetry instance without calling the set method again.
When I follow the stack trace, the issue seems to occur because the get() method calls set() since GlobalOpenTelemetry is null. However, within the set() method, an exception is thrown because GlobalOpenTelemetry is not null.
Despite trying various approaches, I have been unable to reproduce this error. Could you please help me with this issue?
Artifacts: (
opentelemetry-bom
,opentelemetry-sdk
,opentelemetry-api
,opentelemetry-exporter-otlp
,opentelemetry-exporter-logging
,opentelemetry-exporter-otlp-common
)Version: (
1.44.0
)How did you reference these artifacts?
build.gradle
Note: I’m not sure if it matters, but when using version 1.40.0, this error occurred very rarely—maybe once a week at most for users.
Please also share if you have any suggestion regarding how to initialize OpenTelemetry before any of the GlobalOpenTelemetry APIs get invoked automatically by the SDK?
The text was updated successfully, but these errors were encountered: