Skip to content

Commit 26fbfbb

Browse files
codebotenMrAlias
andauthored
fix: update attribute_keys to include type (#111)
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 <[email protected]> Co-authored-by: Tyler Yahn <[email protected]>
1 parent 50fbb1f commit 26fbfbb

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Adding initial instrumentation configuration schema
66
* 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)
7+
* Update `attribute_keys` from array to to Include type [#111](https://github.com/open-telemetry/opentelemetry-configuration/pull/111)
78

89
## [v0.2.0] - 2024-05-08
910

examples/kitchen-sink.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,11 @@ meter_provider:
249249
record_min_max: true
250250
# Configure attribute keys retained in the resulting stream(s).
251251
attribute_keys:
252-
- key1
253-
- key2
252+
# Configure list of attribute keys that are retained in the resulting stream(s).
253+
# All other attributes not matching will be dropped.
254+
included:
255+
- key1
256+
- key2
254257

255258
# Configure text map context propagators.
256259
#

schema/common.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@
3131
}
3232
}
3333
},
34+
"Include": {
35+
"type": "object",
36+
"additionalProperties": false,
37+
"properties": {
38+
"included": {
39+
"type": "array",
40+
"items": {
41+
"type": "string"
42+
}
43+
}
44+
}
45+
},
3446
"Otlp": {
3547
"type": ["object", "null"],
3648
"additionalProperties": false,

schema/meter_provider.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,7 @@
302302
}
303303
},
304304
"attribute_keys": {
305-
"type": "array",
306-
"items": {
307-
"type": ["string", "null"]
308-
}
305+
"$ref": "common.json#/$defs/Include"
309306
}
310307
}
311308
}

0 commit comments

Comments
 (0)