-
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
fix(exporter-logs-otlp-proto): programatic headers take precedence ov… #4351
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4351 +/- ##
==========================================
- Coverage 92.24% 92.22% -0.02%
==========================================
Files 333 333
Lines 9459 9459
Branches 2009 2009
==========================================
- Hits 8725 8724 -1
- Misses 734 735 +1
|
…r environment variables
…er environment variables
…ver environment variable
experimental/packages/exporter-logs-otlp-http/src/platform/node/OTLPLogExporter.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for taking care of this. 🙂
open-telemetry#4351) * fix(exporter-logs-otlp-proto): programatic headers take precedence over environment variables * chore: update PR url in changelog * chore: fix deletion of env var * fix(exporter-logs-otlp-http): programatic headers take precedence over environment variables * fix(exporter-trace-otlp-http): programatic headers take precedence over environment variables * fix(exporter-trace-otlp-proto): programatic headers take precedence over environment variable * chore: update CHANGELOG --------- Co-authored-by: Marc Pichler <[email protected]>
…er environment variables
Which problem is this PR solving?
Exporters are not respecting the documented behaviour (link) when it comes to headers.
Settings configured programmatically take precedence over environment variables. Per-signal environment variables take precedence over non-per-signal environment variables.
Continuation of the previous PR #4334 based on the discussion
#4334 (review)
Fixes #2370
Short description of the changes
override OTEL_EXPORTER_OTLP_METRICS_HEADERS and OTEL_EXPORTER_OTLP_HEADERS with config.headers supplied to OTLPLogExporter and OTLPTraceExporter
Applied to:
Did not change anything in grpc exporters for traces and logs as setting headers for that protocol probably does not make sense:
opentelemetry-js/experimental/packages/otlp-grpc-exporter-base/src/OTLPGRPCExporterNodeBase.ts
Line 52 in 5b0fb7b
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Added additional tests testing that the programmatic settings take precedence.
Checklist: