-
Notifications
You must be signed in to change notification settings - Fork 810
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
Dynamic Header for OTLPTraceExporter - Package @opentelemetry/exporter-trace-otlp-http #2903
Comments
Hmm there are several ways this could be solved I guess
|
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
This is a feature I'd be very interested in - I'd like to add my auth token to the headers so I can validate serverside if traces come from an authenticated source. |
Hi, are there any news about this issue? With the current implementation it seems that the while oauth mechanism will not because its not possible to renew the token used for authentication. |
In case someone is looking for a workaround. This will overwrite the Authorization header every time an export is made:
Where |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
Is your feature request related to a problem?
I am using the package
@opentelemetry/exporter-trace-otlp-http
to export the trace from the browser to the tracing server.The tracing server is behind an authenticated proxy, where the token is provided through the authorization header.
Currently, we can provide custom headers when the exporter is created:
The token can change overtime (when it is renewed for example). I would need a way to provide an up-to-date token to the exporter before the exporter sends the payload.
Describe the solution you'd like
The easiest way would be to provide a way to update the header.
.... store exporter as a global variable
Describe alternatives you've considered
An alternative could be to provide a callback. But it would mean that the token is stored somehow in a global variable. It may not be the workflow that people have. I have my token that is actually updated through an redux action.
Or would it be possible to clear the span processor and add a new one?
Other comments
What would happen if the token is nil? Is there a way to desactivate tracing until the token is issue?
The text was updated successfully, but these errors were encountered: