diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index d8d5624..65ee8f2 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -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 diff --git a/schema/resource.json b/schema/resource.json index 51ae442..80f77fd 100644 --- a/schema/resource.json +++ b/schema/resource.json @@ -8,6 +8,9 @@ "attributes": { "$ref": "#/$defs/Attributes" }, + "detectors": { + "$ref": "#/$defs/Detectors" + }, "schema_url": { "type": "string" } @@ -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" + } + } + } + } + } } } }