-
Notifications
You must be signed in to change notification settings - Fork 516
[SDK] Implement EnvEntityDetector for OTEL_ENTITIES parsing (#3652) #3795
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
Open
Hasv07
wants to merge
2
commits into
open-telemetry:main
Choose a base branch
from
Hasv07:sdk/implement-env-entity-detector
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[SDK] Implement EnvEntityDetector for OTEL_ENTITIES parsing (#3652) #3795
Hasv07
wants to merge
2
commits into
open-telemetry:main
from
Hasv07:sdk/implement-env-entity-detector
+763
−1
Conversation
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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3795 +/- ##
==========================================
+ Coverage 89.93% 90.08% +0.16%
==========================================
Files 225 226 +1
Lines 7163 7305 +142
==========================================
+ Hits 6441 6580 +139
- Misses 722 725 +3
🚀 New features to boost your workflow:
|
1d75005 to
f7a5844
Compare
4e42cbc to
296d576
Compare
…emetry#3652) Changes: Add EnvEntityDetector class to parse OTEL_ENTITIES environment variable Parse entity format: type{id_attrs}[desc_attrs]@schema_url Support percent-encoding for reserved characters Handle duplicate entities, conflicting attributes, and malformed input per spec Include comprehensive test coverage Fix schema URL handling to pass to Resource Details: EnvEntityDetector::Detect() reads OTEL_ENTITIES and returns Resource with parsed attributes ParseEntities() splits input by semicolons and parses each entity definition ParseSingleEntity() extracts type, id_attrs, desc_attrs, and schema_url from entity string ParseKeyValueList() parses comma-separated key=value pairs PercentDecode() decodes percent-encoded values BuildEntityIdentityKey() creates stable key for duplicate detection Error handling: malformed entities skipped, duplicates use last occurrence, conflicts log warnings Implements entity propagation spec: https://opentelemetry.io/docs/specs/otel/entities/entity-propagation
296d576 to
aeec00f
Compare
marcalff
approved these changes
Jan 5, 2026
Member
marcalff
left a comment
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.
LGTM, thanks for the contribution
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.
Related #3652
Changes:
Details:
EnvEntityDetector::Detect()reads OTEL_ENTITIES and returns Resource with parsed attributesParseEntities()splits input by semicolons and parses each entity definitionParseSingleEntity()extracts type, id_attrs, desc_attrs, and schema_url from entity stringParseKeyValueList()parses comma-separated key=value pairsPercentDecode()decodes percent-encoded valuesBuildEntityIdentityKey()creates stable key for duplicate detectionError handlingmalformed entities skipped, duplicates use last occurrence, conflicts log warningsImplements entity propagation spec:
https://opentelemetry.io/docs/specs/otel/entities/entity-propagation/