From a377d995370817fe24ff5c0ebd3abbb615e09b23 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:23:50 -0700 Subject: [PATCH] add headers_list support, similar to attributes_list (#122) Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- examples/kitchen-sink.yaml | 12 ++++++++++++ examples/sdk-migration-config.yaml | 13 ++++++++++++- schema/common.json | 3 +++ schema/meter_provider.json | 3 +++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index fd56325..d47779a 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -79,6 +79,10 @@ logger_provider: # Environment variable: OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS headers: api-key: "1234" + # Configure headers. Entries have lower priority than entries from .headers. + # + # The value is a list of comma separated key-value pairs, matching the format of OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. + headers_list: "api-key=1234" # Configure compression. # # Environment variable: OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_EXPORTER_OTLP_LOGS_COMPRESSION @@ -187,6 +191,10 @@ meter_provider: # Environment variable: OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_METRICS_HEADERS headers: api-key: !!str 1234 + # Configure headers. Entries have lower priority than entries from .headers. + # + # The value is a list of comma separated key-value pairs, matching the format of OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_METRICS_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. + headers_list: "api-key=1234" # Configure compression. # # Environment variable: OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_EXPORTER_OTLP_METRICS_COMPRESSION @@ -314,6 +322,10 @@ tracer_provider: # Environment variable: OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS headers: api-key: !!str 1234 + # Configure headers. Entries have lower priority than entries from .headers. + # + # The value is a list of comma separated key-value pairs, matching the format of OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. + headers_list: "api-key=1234" # Configure compression. # # Environment variable: OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_EXPORTER_OTLP_TRACES_COMPRESSION diff --git a/examples/sdk-migration-config.yaml b/examples/sdk-migration-config.yaml index 26bdaac..a1afd27 100644 --- a/examples/sdk-migration-config.yaml +++ b/examples/sdk-migration-config.yaml @@ -32,7 +32,6 @@ # - OTEL_EXPORTER_OTLP_CERTIFICATE # - OTEL_EXPORTER_OTLP_CLIENT_KEY # - OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE -# - OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_{SIGNAL}_HEADERS # - OTEL_EXPORTER_OTLP_COMPRESSION # - OTEL_EXPORTER_OTLP_TIMEOUT @@ -98,6 +97,10 @@ tracer_provider: timeout: ${OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:-10000} # Configure headers: headers: {} + # Configure headers. Entries have lower priority than entries from .headers. + # + # The value is a list of comma separated key-value pairs, matching the format of OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. + headers_list: ${OTEL_EXPORTER_OTLP_TRACES_HEADERS} # Configure span limits. See also attribute_limits. limits: # Configure max span attribute value size. Overrides attribute_limits.attribute_value_length_limit. @@ -167,6 +170,10 @@ meter_provider: timeout: ${OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:-10000} # Configure headers: headers: {} + # Configure headers. Entries have lower priority than entries from .headers. + # + # The value is a list of comma separated key-value pairs, matching the format of OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_METRICS_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. + headers_list: "{OTEL_EXPORTER_OTLP_METRICS_HEADERS}" # Configure temporality preference. temporality_preference: ${OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:-cumulative} # Configure default histogram aggregation. @@ -206,6 +213,10 @@ logger_provider: timeout: ${OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:-10000} # Configure headers: headers: {} + # Configure headers. Entries have lower priority than entries from .headers. + # + # The value is a list of comma separated key-value pairs, matching the format of OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. + headers_list: "{OTEL_EXPORTER_OTLP_LOGS_HEADERS}" # Configure log record limits. See also attribute_limits. limits: # Configure max log record attribute value size. Overrides attribute_limits.attribute_value_length_limit. diff --git a/schema/common.json b/schema/common.json index 0332633..9dbc50a 100644 --- a/schema/common.json +++ b/schema/common.json @@ -66,6 +66,9 @@ "headers": { "$ref": "#/$defs/Headers" }, + "headers_list": { + "type": ["string", "null"] + }, "compression": { "type": ["string", "null"] }, diff --git a/schema/meter_provider.json b/schema/meter_provider.json index fdaad6f..fa0d732 100644 --- a/schema/meter_provider.json +++ b/schema/meter_provider.json @@ -172,6 +172,9 @@ "headers": { "$ref": "common.json#/$defs/Headers" }, + "headers_list": { + "type": ["string", "null"] + }, "compression": { "type": ["string", "null"] },