Skip to content

Commit

Permalink
Define resource.detectors.attributes.included/excluded (#64)
Browse files Browse the repository at this point in the history
* Define resource.dectectors.disabled_keys, to disable resource attribute keys provided by detectors

* Remove detectors abstraction

* Refactor to use included / excluded
  • Loading branch information
jack-berg authored May 8, 2024
1 parent 834ae3c commit b450ea7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -398,5 +398,23 @@ resource:
#
# Environment variable: OTEL_SERVICE_NAME
service.name: !!str "unknown_service"
# Configure resource detectors.
detectors:
# Configure attributes provided by resource detectors.
attributes:
# Configure list of attribute key patterns to include from resource detectors. If not set, all attributes are included.
#
# Attribute keys from resource detectors are evaluated to match as follows:
# * If the value of the attribute key exactly matches.
# * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
included:
- process.*
# 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).
#
# Attribute keys from resource detectors are evaluated to match as follows:
# * If the value of the attribute key exactly matches.
# * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
excluded:
- process.command_args
# Configure the resource schema URL.
schema_url: https://opentelemetry.io/schemas/1.16.0
29 changes: 29 additions & 0 deletions schema/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"attributes": {
"$ref": "#/$defs/Attributes"
},
"detectors": {
"$ref": "#/$defs/Detectors"
},
"schema_url": {
"type": "string"
}
Expand All @@ -17,6 +20,32 @@
"title": "Attributes",
"type": "object",
"additionalProperties": true
},
"Detectors": {
"title": "Detectors",
"type": "object",
"additionalProperties": false,
"properties": {
"attributes": {
"title": "DetectorAttributes",
"type": "object",
"additionalProperties": false,
"properties": {
"included": {
"type": "array",
"items": {
"type": "string"
}
},
"excluded": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}

0 comments on commit b450ea7

Please sign in to comment.