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 1/4] 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" } } } From d63bb1adef4da1a57beca86a01a37ec91168389e Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:30:42 -0700 Subject: [PATCH 2/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38d3fed..c4cb8fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +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 +* Update `attribute_keys` from array to to Include type [#111](https://github.com/open-telemetry/opentelemetry-configuration/pull/111) ## [v0.2.0] - 2024-05-08 From c1671c4aaee133a121840f6fd1109296758af483 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:51:44 -0700 Subject: [PATCH 3/4] Update examples/kitchen-sink.yaml Co-authored-by: Tyler Yahn --- examples/kitchen-sink.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index e4c766b..ed9a7b0 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -249,7 +249,8 @@ meter_provider: record_min_max: true # Configure attribute keys retained in the resulting stream(s). attribute_keys: - # Configure list of attribute key patterns attribute keys retained in the resulting stream(s). + # Configure list of attribute key patterns that are retained in the resulting stream(s). + # All other attributes not matching will be dropped. included: - key1 - key2 From 5e279460ebf17e51cd36695154ec29b9d5e41fe0 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:28:29 -0700 Subject: [PATCH 4/4] Update examples/kitchen-sink.yaml --- examples/kitchen-sink.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index ed9a7b0..e6b36f4 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -249,7 +249,7 @@ meter_provider: record_min_max: true # Configure attribute keys retained in the resulting stream(s). attribute_keys: - # Configure list of attribute key patterns that are retained in the resulting stream(s). + # Configure list of attribute keys that are retained in the resulting stream(s). # All other attributes not matching will be dropped. included: - key1