Skip to content

Commit 3b0dd36

Browse files
committed
PR review feedback
1 parent 2649534 commit 3b0dd36

1 file changed

Lines changed: 1 addition & 31 deletions

File tree

specification/entities/entity-propagation.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -180,44 +180,14 @@ The SDK SHOULD be resilient to malformed input and follow these error handling r
180180

181181
Example: `OTEL_ENTITIES="service{service.name=app1}@invalid-url"` processes the entity but ignores the invalid URL
182182

183-
5. **Conflicting identifying attributes**: If two entities of the same type define different values for the same identifying attribute key, the SDK SHOULD treat them as separate entities. If this results in ambiguous entity identification, the SDK SHOULD log a warning and preserve only the last entity
183+
5. **Conflicting identifying attributes**: If two entities of the same type define different values for the same identifying attribute key, the SDK SHOULD log a warning and preserve only the last entity
184184

185185
Example: `OTEL_ENTITIES="service{service.name=app1};service{service.name=app2}"` creates only service.name=app2 entity
186186

187187
6. **Conflicting descriptive attributes**: If two entities define different values for the same descriptive attribute key, the SDK SHOULD use the value from the last entity definition and SHOULD log a warning. The conflicting attributes SHOULD NOT be recorded for entities other than the last one
188188

189189
Example: `OTEL_ENTITIES="service{service.name=app1}[version=1.0];service{service.name=app2}[version=2.0]"` results in app1 service without version attribute and app2 service with `version=2.0`
190190

191-
### Environment Variable Conflict Resolution
192-
193-
When multiple environment variables define overlapping configuration, a warning should be logged and the following precedence order applied (highest to lowest precedence):
194-
195-
1. **Programmatic configuration**: Entities configured via SDK API take highest precedence and override all environment variable configurations
196-
2. **OTEL_ENTITIES**: Entity definitions from this environment variable override resource attributes and other OTEL_* environment variables for the same attribute keys
197-
3. **OTEL_SERVICE_NAME**: Takes precedence over `service.name` in `OTEL_RESOURCE_ATTRIBUTES` but is overridden by `service.name` in `OTEL_ENTITIES`
198-
4. **Other specific OTEL_* variables**: Individual environment variables (when they exist) take precedence over equivalent attributes in `OTEL_RESOURCE_ATTRIBUTES`
199-
5. **OTEL_RESOURCE_ATTRIBUTES**: Lowest precedence for overlapping attribute keys
200-
201-
**Precedence rules within OTEL_ENTITIES:**
202-
203-
- When the same entity type appears multiple times with identical identifying attributes, the last occurrence takes precedence
204-
205-
**Example of conflict resolution:**
206-
207-
```bash
208-
# These environment variables:
209-
OTEL_SERVICE_NAME="old-service-name"
210-
OTEL_RESOURCE_ATTRIBUTES="service.name=resource-service,host.name=resource-host,custom.attr=resource-value"
211-
OTEL_ENTITIES="service{service.name=entity-service,service.instance.id=inst-1}[service.version=1.0.0];host{host.id=host-123}[host.name=entity-host]"
212-
213-
# Result in:
214-
# - Service entity with identifying attributes: {service.name=entity-service, service.instance.id=inst-1} (from OTEL_ENTITIES, overrides others)
215-
# and descriptive attributes: {service.version=1.0.0}
216-
# - Host entity with identifying attributes: {host.id=host-123}
217-
# and descriptive attributes: {host.name=entity-host} (from OTEL_ENTITIES, overrides OTEL_RESOURCE_ATTRIBUTES)
218-
# - Resource: remaining attributes from OTEL_RESOURCE_ATTRIBUTES that don't conflict: {custom.attr=resource-value}
219-
```
220-
221191
## EnvEntityDetector
222192

223193
TODO: fill out

0 commit comments

Comments
 (0)