From e21ffdbf87b1d51436754e83a61a4147bfb1b28b Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:42:25 -0700 Subject: [PATCH] stream: update stream configuration to include/exclude (#118) This follows https://github.com/open-telemetry/opentelemetry-specification/pull/4188 to add support to exclude attribute keys from stream configuration. --------- Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- examples/kitchen-sink.yaml | 5 ++++- schema/common.json | 12 ------------ schema/meter_provider.json | 2 +- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index c179645..4e418a5 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -144,7 +144,7 @@ meter_provider: # Configure resource attributes to be included, in this example attributes starting with service. included: - "service*" - # Configure resource attributes to be excluded, in this example attribute service.attr1. + # Configure resource attributes to be excluded, in this example attribute service.attr1. Applies after .with_resource_constant_labels.included (i.e. excluded has higher priority than included). excluded: - "service.attr1" # Configure metric producers. @@ -264,6 +264,9 @@ meter_provider: included: - key1 - key2 + # Configure list of attribute keys that are excluded in the resulting stream(s), in this example attribute key3. Applies after .attribute_keys.included (i.e. excluded has higher priority than included). + excluded: + - key3 # Configure text map context propagators. # diff --git a/schema/common.json b/schema/common.json index 37f8a3f..b0609b5 100644 --- a/schema/common.json +++ b/schema/common.json @@ -22,18 +22,6 @@ } } }, - "Include": { - "type": "object", - "additionalProperties": false, - "properties": { - "included": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "NameStringValuePair": { "type": "object", "additionalProperties": false, diff --git a/schema/meter_provider.json b/schema/meter_provider.json index dc08eef..461ec30 100644 --- a/schema/meter_provider.json +++ b/schema/meter_provider.json @@ -308,7 +308,7 @@ } }, "attribute_keys": { - "$ref": "common.json#/$defs/Include" + "$ref": "common.json#/$defs/IncludeExclude" } } }