Skip to content

Commit

Permalink
add headers_list support, similar to attributes_list (#122)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten authored Sep 17, 2024
1 parent 2a69092 commit a377d99
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
12 changes: 12 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion examples/sdk-migration-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions schema/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
"headers": {
"$ref": "#/$defs/Headers"
},
"headers_list": {
"type": ["string", "null"]
},
"compression": {
"type": ["string", "null"]
},
Expand Down
3 changes: 3 additions & 0 deletions schema/meter_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@
"headers": {
"$ref": "common.json#/$defs/Headers"
},
"headers_list": {
"type": ["string", "null"]
},
"compression": {
"type": ["string", "null"]
},
Expand Down

0 comments on commit a377d99

Please sign in to comment.