-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Set otel exporter headers value during runtime. #5129
Comments
I feel this is a legitimate request. |
I see two ways we could do this:
I'd lean towards the second option, as with the first one, the added method would be in a rather hot path. And the second one should allow more flexibility. |
I am not sure if adding options like The client may know the token's expiration date. However, the token could be invalidated sooner than that. |
@dmathieu @XSAM @pellared Thanks for looking into this issue. While before this is implemented, I would like to find a workaround to achieve what I need. I tried to create a new metric.MeterProvider and call Thanks for the help! |
Providers are additive, not replacing each other. So this approach won't be valid. I would instead setup a custom exporter, with a way to replace the header value at runtime. |
Problem Statement
Sorry if this is not a feasible question.
I am trying to use otel exporter lib to export otel data to an otel collector. And I need to set auth header. This is what I do:
The problem is that I cannot find an API to update the header once the exporter is initialized but when the token is expired, seems the only way is to create another exporter instance.
Is there a way to update the header in the exporter? or if there is not, is it Okay to add an API to update that?
The text was updated successfully, but these errors were encountered: