From 2486516e3785ff4a9821c9307e07edc2de951668 Mon Sep 17 00:00:00 2001 From: S-mishina <45090872+S-mishina@users.noreply.github.com> Date: Sat, 22 Feb 2025 03:01:15 +0900 Subject: [PATCH] Add optional propagators configuration for trace context propagation (#1664) * Add optional propagators configuration for trace context propagation Signed-off-by: S-mishina <45090872+S-mishina@users.noreply.github.com> * fix values.schema Signed-off-by: S-mishina <45090872+S-mishina@users.noreply.github.com> * Enable support for custom propagators in Instrumentation Configuration Signed-off-by: S-mishina <45090872+S-mishina@users.noreply.github.com> * Update .chloggen/featureaddoptionalpropagatorsconfig.yaml Co-authored-by: Jina Jain --------- Signed-off-by: S-mishina <45090872+S-mishina@users.noreply.github.com> Co-authored-by: Jina Jain --- .../featureaddoptionalpropagatorsconfig.yaml | 13 +++++++++++++ .../templates/operator/instrumentation.yaml | 6 +++--- .../splunk-otel-collector/values.schema.json | 17 +++++++++++++++++ helm-charts/splunk-otel-collector/values.yaml | 14 +++++++++++++- 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 .chloggen/featureaddoptionalpropagatorsconfig.yaml diff --git a/.chloggen/featureaddoptionalpropagatorsconfig.yaml b/.chloggen/featureaddoptionalpropagatorsconfig.yaml new file mode 100644 index 000000000..a43ad9e1a --- /dev/null +++ b/.chloggen/featureaddoptionalpropagatorsconfig.yaml @@ -0,0 +1,13 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: "enhancement" +# The name of the component, or a single word describing the area of concern, (e.g. agent, clusterReceiver, gateway, operator, chart, other) +component: "chart" +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Enable support for custom propagators in `spec.propagators` within Instrumentation Configuration." +# One or more tracking issues related to the change +issues: [1663] +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + This change allows users to specify custom propagators in `spec.propagators` when configuring OpenTelemetry Instrumentation. diff --git a/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml b/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml index 9ad4b4d9f..970dc25dc 100644 --- a/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml +++ b/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml @@ -21,10 +21,10 @@ metadata: spec: exporter: endpoint: {{ include "splunk-otel-collector.operator.instrumentation-exporter-endpoint" . }} + {{- with .Values.instrumentation.propagators }} propagators: - - tracecontext - - baggage - - b3 + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.instrumentation.sampler }} sampler: {{- toYaml . | nindent 4 }} diff --git a/helm-charts/splunk-otel-collector/values.schema.json b/helm-charts/splunk-otel-collector/values.schema.json index 8cabd4489..af1ec30cc 100644 --- a/helm-charts/splunk-otel-collector/values.schema.json +++ b/helm-charts/splunk-otel-collector/values.schema.json @@ -1500,6 +1500,23 @@ "type": "string", "description": "Optional endpoint parameter for exporting data to a specific target." }, + "propagators": { + "type": "array", + "description": "Optional propagators parameter for enabling trace context propagation.", + "items": { + "type": "string", + "enum": [ + "tracecontext", + "baggage", + "b3", + "b3multi", + "jaeger", + "ottrace", + "xray", + "none" + ] + } + }, "sampler": { "type": "object", "description": "Optional sampler parameter for enabling trace sampling.", diff --git a/helm-charts/splunk-otel-collector/values.yaml b/helm-charts/splunk-otel-collector/values.yaml index 736d57f84..e80cd276d 100644 --- a/helm-charts/splunk-otel-collector/values.yaml +++ b/helm-charts/splunk-otel-collector/values.yaml @@ -1238,7 +1238,19 @@ instrumentation: endpoint: "" # endpoint: http://$(SPLUNK_OTEL_AGENT):4317 # endpoint: http://splunk-otel-collector:4317 - + # Optional "propagators" parameter for enabling trace context propagation, see: https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_propagators + propagators: + - tracecontext + - baggage + - b3 + # "tracecontext": W3C Trace Context + # "baggage": W3C Baggage + # "b3": B3 Single + # "b3multi": B3 Multi + # "jaeger": Jaeger + # "xray": AWS X-Ray (third party) + # "ottrace": OT Trace (third party) + # "none": No automatically configured propagator. # Optional "sampler" parameter for enabling trace sampling, see: https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_traces_sampler sampler: {} # type: traceidratio