From 0710fe96723c0b794240cf9d622578089662c391 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Thu, 10 Oct 2024 13:36:20 -0500 Subject: [PATCH 1/2] Add .meter_provider.exemplar_filter property --- examples/kitchen-sink.yaml | 2 ++ examples/sdk-config.yaml | 2 ++ examples/sdk-migration-config.yaml | 3 ++- schema/meter_provider.json | 10 ++++++++++ schema/type_descriptions.yaml | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index 04f2a31..d9e56f0 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -213,6 +213,8 @@ meter_provider: # Configure list of attribute keys to exclude from the resulting stream(s). Applies after .attribute_keys.included (i.e. excluded has higher priority than included). excluded: - key3 + # Configure the exemplar filter. Known values include: trace_based, always_on, always_off. + exemplar_filter: trace_based # Configure text map context propagators. propagator: diff --git a/examples/sdk-config.yaml b/examples/sdk-config.yaml index 71dad2d..57390d6 100644 --- a/examples/sdk-config.yaml +++ b/examples/sdk-config.yaml @@ -139,6 +139,8 @@ meter_provider: temporality_preference: cumulative # Configure default histogram aggregation. default_histogram_aggregation: explicit_bucket_histogram + # Configure the exemplar filter. Known values include: trace_based, always_on, always_off. + exemplar_filter: trace_based # Configure logger provider. logger_provider: diff --git a/examples/sdk-migration-config.yaml b/examples/sdk-migration-config.yaml index a1b842a..1f9ca44 100644 --- a/examples/sdk-migration-config.yaml +++ b/examples/sdk-migration-config.yaml @@ -25,7 +25,6 @@ # - OTEL_TRACES_EXPORTER # - OTEL_METRICS_EXPORTER # - OTEL_LOGS_EXPORTER -# - OTEL_METRICS_EXEMPLAR_FILTER # - OTEL_EXPORTER_OTLP_PROTOCOL # - OTEL_EXPORTER_OTLP_ENDPOINT # - OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_{SIGNAL}_INSECURE @@ -177,6 +176,8 @@ meter_provider: temporality_preference: ${OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:-cumulative} # Configure default histogram aggregation. default_histogram_aggregation: ${OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION:-explicit_bucket_histogram} + # Configure the exemplar filter. Known values include: trace_based, always_on, always_off. + exemplar_filter: ${OTEL_METRICS_EXEMPLAR_FILTER:-trace_based} # Configure logger provider. logger_provider: diff --git a/schema/meter_provider.json b/schema/meter_provider.json index 461ec30..b5eeebf 100644 --- a/schema/meter_provider.json +++ b/schema/meter_provider.json @@ -16,6 +16,16 @@ "items": { "$ref": "#/$defs/View" } + }, + "exemplar_filter": { + "type": { + "enum": [ + null, + "always_on", + "always_off", + "trace_based" + ] + } } }, "$defs": { diff --git a/schema/type_descriptions.yaml b/schema/type_descriptions.yaml index 5abfefa..12ea1ab 100644 --- a/schema/type_descriptions.yaml +++ b/schema/type_descriptions.yaml @@ -203,6 +203,7 @@ property_descriptions: readers: Configure metric readers. views: Configure views. Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s). + exemplar_filter: "Configure the exemplar filter. Known values include: trace_based, always_on, always_off." path_patterns: - .meter_provider From 5779b13ef2ca28d069070811db6ce6f8ace869a0 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Thu, 10 Oct 2024 13:41:53 -0500 Subject: [PATCH 2/2] Fix build --- schema/meter_provider.json | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/schema/meter_provider.json b/schema/meter_provider.json index b5eeebf..7a2d288 100644 --- a/schema/meter_provider.json +++ b/schema/meter_provider.json @@ -18,14 +18,12 @@ } }, "exemplar_filter": { - "type": { - "enum": [ - null, - "always_on", - "always_off", - "trace_based" - ] - } + "type": ["string", "null"], + "enum": [ + "always_on", + "always_off", + "trace_based" + ] } }, "$defs": {