Skip to content

Commit b450ea7

Browse files
authored
Define resource.detectors.attributes.included/excluded (#64)
* Define resource.dectectors.disabled_keys, to disable resource attribute keys provided by detectors * Remove detectors abstraction * Refactor to use included / excluded
1 parent 834ae3c commit b450ea7

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

examples/kitchen-sink.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,5 +398,23 @@ resource:
398398
#
399399
# Environment variable: OTEL_SERVICE_NAME
400400
service.name: !!str "unknown_service"
401+
# Configure resource detectors.
402+
detectors:
403+
# Configure attributes provided by resource detectors.
404+
attributes:
405+
# Configure list of attribute key patterns to include from resource detectors. If not set, all attributes are included.
406+
#
407+
# Attribute keys from resource detectors are evaluated to match as follows:
408+
# * If the value of the attribute key exactly matches.
409+
# * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
410+
included:
411+
- process.*
412+
# Configure list of attribute key patterns to exclude from resource detectors. Applies after .resource.detectors.attributes.included (i.e. excluded has higher priority than included).
413+
#
414+
# Attribute keys from resource detectors are evaluated to match as follows:
415+
# * If the value of the attribute key exactly matches.
416+
# * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
417+
excluded:
418+
- process.command_args
401419
# Configure the resource schema URL.
402420
schema_url: https://opentelemetry.io/schemas/1.16.0

schema/resource.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"attributes": {
99
"$ref": "#/$defs/Attributes"
1010
},
11+
"detectors": {
12+
"$ref": "#/$defs/Detectors"
13+
},
1114
"schema_url": {
1215
"type": "string"
1316
}
@@ -17,6 +20,32 @@
1720
"title": "Attributes",
1821
"type": "object",
1922
"additionalProperties": true
23+
},
24+
"Detectors": {
25+
"title": "Detectors",
26+
"type": "object",
27+
"additionalProperties": false,
28+
"properties": {
29+
"attributes": {
30+
"title": "DetectorAttributes",
31+
"type": "object",
32+
"additionalProperties": false,
33+
"properties": {
34+
"included": {
35+
"type": "array",
36+
"items": {
37+
"type": "string"
38+
}
39+
},
40+
"excluded": {
41+
"type": "array",
42+
"items": {
43+
"type": "string"
44+
}
45+
}
46+
}
47+
}
48+
}
2049
}
2150
}
2251
}

0 commit comments

Comments
 (0)