You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SDK SHOULD be resilient to malformed input and follow these error handling rules:
139
139
140
140
1.**Invalid syntax**: If the environment variable contains invalid syntax, the SDK SHOULD log a warning and ignore the malformed portions while processing valid parts
141
+
142
+
Example: `OTEL_ENTITIES="service{service.name=app1};invalid{syntax;service{service.name=app2}"` processes the first valid entity and skips the malformed part
143
+
141
144
2.**Missing required fields**: If an entity is missing required fields (type or identifying attributes), the SDK SHOULD log a warning and skip that entity
142
-
3.**Empty entities list**: An empty `OTEL_ENTITIES` environment variable is valid and indicates no entities are defined
143
-
4.**Empty entity strings**: Empty strings between semicolons (including leading and trailing semicolons) SHOULD be ignored during parsing
144
-
5.**Duplicate entities**: If multiple entities of the same type with identical identifying attributes are defined, the SDK SHOULD use the last occurrence and SHOULD log a warning
145
-
6.**Invalid characters**: If unencoded reserved characters are found in attribute keys or values, the SDK SHOULD log a warning and attempt to parse the value as-is
146
-
7.**Schema URL validation**: If a schema URL is present but invalid, the SDK SHOULD log a warning and ignore the URL while processing the entity
147
-
8.**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 use the last valid definition
148
-
9.**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
149
-
10.**Conflict with resource attributes**: If an entity attribute conflicts with a resource attribute, the SDK SHOULD log a warning and apply the conflict resolution rules defined below
145
+
146
+
Example: `OTEL_ENTITIES="service{};host{host.id=123}"` skips the service entity (no identifying attributes) and processes the host entity
147
+
148
+
3.**Duplicate entities**: If multiple entities of the same type with identical identifying attributes are defined, the SDK SHOULD use the last occurrence and SHOULD log a warning
4.**Schema URL validation**: If a schema URL is present but invalid, the SDK SHOULD log a warning and ignore the URL while processing the entity
153
+
154
+
Example: `OTEL_ENTITIES="service{service.name=app1}@invalid-url"` processes the entity but ignores the invalid URL
155
+
156
+
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
157
+
158
+
Example: `OTEL_ENTITIES="service{service.name=app1};service{service.name=app2}"` creates only service.name=app2 entity
159
+
160
+
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
161
+
162
+
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`
150
163
151
164
### Environment Variable Conflict Resolution
152
165
153
-
When multiple environment variables define overlapping configuration, the following precedence order applies (highest to lowest precedence):
166
+
When multiple environment variables define overlapping configuration, a warning should be logged and the following precedence order applied (highest to lowest precedence):
154
167
155
168
1.**Programmatic configuration**: Entities configured via SDK API take highest precedence and override all environment variable configurations
156
169
2.**OTEL_ENTITIES**: Entity definitions from this environment variable override resource attributes and other OTEL_* environment variables for the same attribute keys
0 commit comments