diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f08390..c4cb8fa 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 [#111](https://github.com/open-telemetry/opentelemetry-configuration/pull/111) ## [v0.2.0] - 2024-05-08 diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index 4fb89ad..fd56325 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -249,8 +249,11 @@ meter_provider: record_min_max: true # Configure attribute keys retained in the resulting stream(s). attribute_keys: - - key1 - - key2 + # Configure list of attribute keys that are retained in the resulting stream(s). + # All other attributes not matching will be dropped. + 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" } } }