-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Error: Attempted duplicate registration of API: context & propagation #32897
Comments
@pieterjandebruyne These errors typically occur when the OpenTelemetry SDK has been initialized multiple times. Please make sure that you're not initializing multiple times. It would also help to see what your |
Hi @JacksonWeber, Thanks for looking into this. I don't think I am initialising it more then once, I only get the setup log 1 time at least and the error triggers from that first run. Thanks already. // index.ts
// instruments.ts
// setupOpenTelemetry.ts
//package.json
// tsconfig.json
|
As a note to the additional packages you see in package.json
I had these added before because I wanted to add additional isntrumentation tools:
I stripped the instrumentations part before to have a more minimal setup to test first, but that was already giving me errors. |
@pieterjandebruyne Ah, your issue is overriding the global tracer provider when you're doing:
You shouldn't need to register a global tracerProvider here, or a meterProvider as the @azure/monitor-opentelemetry package will do that for you. If you take that out your code should stop throwing those warnings. Let me know if that works as expected for you. |
@JacksonWeber I already stripped that part off my code for initial testing, but it kept throwing those errors. As you can see in my original post, I did not include any other code than In regards to the tracerProvider, isn't it the same code that is currently in the documentation, should that also be updated? |
@pieterjandebruyne The 439 Daily Quota error appears to be a possible issue on the ingestion side. It should be transitory and is considered retriable so you should not lose any telemetry. If you do experience telemetry loss, please let me know. The code in the example you provided is getting a delegate tracer provider not creating a new tracer provider. Just so I can understand the issue better, can you please provide me the minimum relevant pieces of code? I see your original example but I only ever get the warning you've mentioned. |
@azure/monitor-opentelemetry
1.8.1
docker [- linux] node:20.9.0-alpine -> running in a container app
20.9
5.7.2
Describe the bug
Error: @opentelemetry/api: Attempted duplicate registration of API: context
Error: @opentelemetry/api: Attempted duplicate registration of API: propagation
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No errors
Additional context
First I get
But googling this error it seems like I can ignore it.
Then I get Errors:
@opentelemetry/api: Attempted duplicate registration of API: context
@opentelemetry/api: Attempted duplicate registration of API: propagation
I followed the documentation, tried without instrumentationOptions, also tried with additional
registerInstrumentations
but nothing seems to resolve these errors.I also later get this error:
but I am unable to find any information about daily quota's, neither have I ever set one up.
The text was updated successfully, but these errors were encountered: