feat(nodejs): drop the trailing comma from OTEL_RESOURCE_ATTRIBUTES#2171
Merged
wpessers merged 1 commit intoopen-telemetry:mainfrom Mar 14, 2026
Conversation
…hen the env var is not set
herin049
approved these changes
Mar 14, 2026
Contributor
|
Honestly, it might be worth submitting a PR to OpenTelemetry Node.js to fix this, since I wouldn't expect trailing commas to be an error. Pretty sure in Python we just ignore anything that parses to pure whitespace after splitting the string. |
Member
Author
Fair point @herin049! I will follow up in the js-contrib on this! |
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.
For the @opentelemetry/core upgrade to
2.6.0in #2165 there's a breaking change regarding parsing of theOTEL_RESOURCE_ATTRIBUTESand:Due to the current code leaving a trailing comma in the
$OTEL_RESOURCE_ATTRIBUTESvalue in the case where the user has it unset or empty, specifically this code in the upstream package would lead to an error being thrown:https://github.com/open-telemetry/opentelemetry-js/blob/425bbfe4b341de82a07f16086a69787b31e97b9d/packages/opentelemetry-resources/src/detectors/EnvDetector.ts#L76-L92