From 387251b90ac4563f41f007172812d696822a5916 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:26:17 -0700 Subject: [PATCH] fix: update attribute_keys to include type This updates the stream's `attribute_keys` configuration to an include/exclude style object that currently only supports `included`. This is in hope to support `excluded` in the future once the specification allows it. Fixes #98 Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- CHANGELOG.md | 1 + examples/kitchen-sink.yaml | 6 ++++-- schema/common.json | 12 ++++++++++++ schema/meter_provider.json | 5 +---- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f08390..38d3fed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Adding initial instrumentation configuration schema * Split MetricExporter into PullMetricExporter and PushMetricExporter and ensure only PushMetricExporters can be associated with PeriodicMetricReader [#110](https://github.com/open-telemetry/opentelemetry-configuration/pull/110) +* Update `attribute_keys` from array to to Include type ## [v0.2.0] - 2024-05-08 diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index 3e0671f..e4c766b 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -249,8 +249,10 @@ meter_provider: record_min_max: true # Configure attribute keys retained in the resulting stream(s). attribute_keys: - - key1 - - key2 + # Configure list of attribute key patterns attribute keys retained in the resulting stream(s). + included: + - key1 + - key2 # Configure text map context propagators. # diff --git a/schema/common.json b/schema/common.json index b4ff765..0332633 100644 --- a/schema/common.json +++ b/schema/common.json @@ -31,6 +31,18 @@ } } }, + "Include": { + "type": "object", + "additionalProperties": false, + "properties": { + "included": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "Otlp": { "type": ["object", "null"], "additionalProperties": false, diff --git a/schema/meter_provider.json b/schema/meter_provider.json index 44bd71b..fdaad6f 100644 --- a/schema/meter_provider.json +++ b/schema/meter_provider.json @@ -302,10 +302,7 @@ } }, "attribute_keys": { - "type": "array", - "items": { - "type": ["string", "null"] - } + "$ref": "common.json#/$defs/Include" } } }