feat(opentelemetry-node): capture HTTP headers, configurable by envvars#1349
Merged
feat(opentelemetry-node): capture HTTP headers, configurable by envvars#1349
Conversation
This adds support for the following envvars to configure HTTP header capture
by the 'http' and 'undici' instrumentations:
ELASTIC_OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_REQUEST_HEADERS
ELASTIC_OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_RESPONSE_HEADERS
ELASTIC_OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_REQUEST_HEADERS
ELASTIC_OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_RESPONSE_HEADERS
OTel Java and Python already have envvars of the same name (without the
'ELASTIC_' prefix, of course).
Closes: #1203
Vale Linting ResultsSummary: 1 suggestion found 💡 Suggestions (1)
The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
🔍 Preview links for changed docs |
…y added to Node.js's fetch/Response impl in v22.3.0
theletterf
approved these changes
Feb 10, 2026
david-luna
reviewed
Feb 19, 2026
packages/opentelemetry-node/test/fixtures/use-capture-headers.js
Outdated
Show resolved
Hide resolved
packages/opentelemetry-node/test/ELASTIC_OTEL_INSTRUMENTATION_HTTP_X_CAPTURE_X_HEADERS.test.js
Outdated
Show resolved
Hide resolved
david-luna
approved these changes
Feb 23, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds support for the following envvars to configure HTTP header capture
by the 'http' and 'undici' instrumentations:
ELASTIC_OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_REQUEST_HEADERS
ELASTIC_OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_RESPONSE_HEADERS
ELASTIC_OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_REQUEST_HEADERS
ELASTIC_OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_RESPONSE_HEADERS
OTel Java and Python already have envvars of the same name (without the
'ELASTIC_' prefix, of course).
Closes: #1203
Checklist
s/-/_/gnormalization for SemconvStable: instr-http header capture (viaheadersToSpanAttributes) should not normalize-to_in attribute name for SemconvStable open-telemetry/opentelemetry-js#6381