-
Notifications
You must be signed in to change notification settings - Fork 807
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(exporters): use parseHeaders() to ensure header-values are not 'undefined' #4540
Merged
pichlermarc
merged 4 commits into
open-telemetry:main
from
dynatrace-oss-contrib:fix/exporter-headers
Mar 14, 2024
Merged
fix(exporters): use parseHeaders() to ensure header-values are not 'undefined' #4540
pichlermarc
merged 4 commits into
open-telemetry:main
from
dynatrace-oss-contrib:fix/exporter-headers
Mar 14, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pichlermarc
added
bug
Something isn't working
priority:p1
Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc
pkg:exporter-trace-otlp-http
pkg:exporter-trace-otlp-proto
pkg:exporter-metrics-otlp-http
pkg:exporter-metrics-otlp-proto
labels
Mar 12, 2024
pichlermarc
force-pushed
the
fix/exporter-headers
branch
from
March 12, 2024 13:03
60f7ebd
to
02dc846
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4540 +/- ##
==========================================
- Coverage 92.83% 92.71% -0.13%
==========================================
Files 328 327 -1
Lines 9481 9455 -26
Branches 2031 2031
==========================================
- Hits 8802 8766 -36
- Misses 679 689 +10
|
pichlermarc
force-pushed
the
fix/exporter-headers
branch
from
March 12, 2024 14:05
11d923d
to
85d3d4c
Compare
trentm
approved these changes
Mar 14, 2024
This was referenced May 28, 2024
Open
Zirak
pushed a commit
to Zirak/opentelemetry-js
that referenced
this pull request
Sep 14, 2024
…ndefined' (open-telemetry#4540) * fix(exporters): use parseHeaders() to ensure header-values are not 'undefined' * chore: changelog * fixup! fix(exporters): use parseHeaders() to ensure header-values are not 'undefined'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
pkg:exporter-metrics-otlp-http
pkg:exporter-metrics-otlp-proto
pkg:exporter-trace-otlp-http
pkg:exporter-trace-otlp-proto
priority:p1
Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
When passing an options object like
{ headers: { foo: undefined } }
to the http/json and http/protobuf exporters, the headers will not be validated and that will causeopentelemetry-js/experimental/packages/otlp-exporter-base/src/platform/node/util.ts
Line 89 in abfe059
to throw, as we're passing an
undefined
header value. While this alone will not cause an application crash, trying to accessreq
atopentelemetry-js/experimental/packages/otlp-exporter-base/src/platform/node/util.ts
Line 62 in abfe059
will cause the end-user's application to crash within typically 10s after the first export (when using defaults).
This PR fixes this by sanitizing these headers first using
parseHeaders()
.Fixes #4541
Type of change