diff --git a/.chloggen/operator-instrumentation-update.yaml b/.chloggen/operator-instrumentation-update.yaml new file mode 100644 index 0000000000..52756797fb --- /dev/null +++ b/.chloggen/operator-instrumentation-update.yaml @@ -0,0 +1,12 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking +# The name of the component, or a single word describing the area of concern, (e.g. agent, clusterReceiver, gateway, operator, chart, other) +component: operator +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Operator Helm values previously under `.Values.operator.instrumentation.spec.*` have been moved to `.Values.instrumentation.*` +# One or more tracking issues related to the change +issues: [1436] +# (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: If you use custom values under `.Values.operator.instrumentation.spec.*` please review the [upgrade guidelines](https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UPGRADING.md#01055-01080) diff --git a/.github/workflows/update_docker_images.yaml b/.github/workflows/update_docker_images.yaml index 9a68706ab8..545ca4e6eb 100644 --- a/.github/workflows/update_docker_images.yaml +++ b/.github/workflows/update_docker_images.yaml @@ -25,16 +25,16 @@ jobs: - name: 'java' component: 'operator' yaml_file_path: 'helm-charts/splunk-otel-collector/values.yaml' - yaml_value_path: '.operator.instrumentation.spec.java' + yaml_value_path: '.instrumentation.java' filter: 'v2.' - name: 'nodejs' component: 'operator' yaml_file_path: 'helm-charts/splunk-otel-collector/values.yaml' - yaml_value_path: '.operator.instrumentation.spec.nodejs' + yaml_value_path: '.instrumentation.nodejs' - name: 'dotnet' component: 'operator' yaml_file_path: 'helm-charts/splunk-otel-collector/values.yaml' - yaml_value_path: '.operator.instrumentation.spec.dotnet' + yaml_value_path: '.instrumentation.dotnet' - name: 'fluentd-hec' component: 'agent' yaml_file_path: 'helm-charts/splunk-otel-collector/values.yaml' diff --git a/Makefile b/Makefile index 52f14e5c9c..bdacabab2f 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,7 @@ pre-commit: render ## Test the Helm chart with pre-commit .PHONY: unittest unittest: ## Run unittests on the Helm chart @echo "Running unit tests on helm chart..." - cd helm-charts/splunk-otel-collector && helm unittest --strict -f ../../test/unittests/*.yaml . || exit 1 + cd helm-charts/splunk-otel-collector && helm unittest --strict -f "../../test/unittests/*.yaml" . || exit 1 ##@ Changelog # Tasks related to changelog management diff --git a/UPGRADING.md b/UPGRADING.md index 8c4250a70d..774f3e5f49 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,5 +1,37 @@ # Upgrade guidelines +## 0.105.5 to 0.108.0 + +We've simplified the Helm chart configuration for `operator` auto-instrumentation. +The values previously under `.Values.operator.instrumentation.spec.*` have been moved to `.Values.instrumentation.*`. + +- **No Action Needed**: If you have no customizations under `.Values.operator.instrumentation.spec.*`, no migration is required. +- **Action Required**: Continuing to use the old values path will result in a Helm install or upgrade error, blocking the process. + +Migration Steps: + +1. **Find** any references to `.Values.operator.instrumentation.spec.*` in your Helm values with custom values. +2. **Migrate** them from `.Values.operator.instrumentation.spec.*` to `.Values.instrumentation.*`. + +Example Migration: + +Before (Deprecated Path): + +```yaml +operator: + instrumentation: + spec: + endpoint: XXX + ... +``` + +After (Updated Path): +```yaml +instrumentation: + endpoint: XXX + ... +``` + ## 0.105.3 to 0.105.4 The `Java instrumentation` for Operator auto-instrumentation has been upgraded from v1.32.2 to v2.7.0. diff --git a/helm-charts/splunk-otel-collector/templates/operator/_helpers.tpl b/helm-charts/splunk-otel-collector/templates/operator/_helpers.tpl index 1d24d3860f..0e14c1bb11 100644 --- a/helm-charts/splunk-otel-collector/templates/operator/_helpers.tpl +++ b/helm-charts/splunk-otel-collector/templates/operator/_helpers.tpl @@ -12,10 +12,10 @@ Helper to ensure the correct usage of the Splunk OpenTelemetry Collector Operato {{- /* Check if the endpoint is overridden in the Helm values */ -}} {{- $endpointOverridden := and - .Values.operator.instrumentation.spec - .Values.operator.instrumentation.spec.exporter - .Values.operator.instrumentation.spec.exporter.endpoint - (ne .Values.operator.instrumentation.spec.exporter.endpoint "") + .Values.instrumentation + .Values.instrumentation.exporter + .Values.instrumentation.exporter.endpoint + (ne .Values.instrumentation.exporter.endpoint "") -}} {{- /* Validate the configuration */ -}} @@ -40,12 +40,12 @@ Helper to define an endpoint for exporting telemetry data related to auto-instru {{- /* Use the user-defined endpoint if specified in the Helm values */ -}} {{- if and - .Values.operator.instrumentation.spec - .Values.operator.instrumentation.spec.exporter - .Values.operator.instrumentation.spec.exporter.endpoint - (ne .Values.operator.instrumentation.spec.exporter.endpoint "") + .Values.instrumentation + .Values.instrumentation.exporter + .Values.instrumentation.exporter.endpoint + (ne .Values.instrumentation.exporter.endpoint "") }} - {{- $endpoint = .Values.operator.instrumentation.spec.exporter.endpoint -}} + {{- $endpoint = .Values.instrumentation.exporter.endpoint -}} {{- /* Use the agent service endpoint if the agent is enabled */ -}} {{- else if .Values.agent.service.enabled -}} {{- $endpoint = printf "http://%s-agent.%s.svc.cluster.local:4317" (include "splunk-otel-collector.fullname" .) .Release.Namespace -}} @@ -57,7 +57,7 @@ Helper to define an endpoint for exporting telemetry data related to auto-instru {{- $endpoint = printf "http://%s:4317" (include "splunk-otel-collector.fullname" .) -}} {{- /* Fail if no valid endpoint is available */ -}} {{- else -}} - {{- fail "When operator.enabled=true, (splunkPlatform.tracesEnabled=true or splunkObservability.tracesEnabled=true), either agent.enabled=true, gateway.enabled=true, or .Values.operator.instrumentation.spec.exporter.endpoint must be set" -}} + {{- fail "When operator.enabled=true, (splunkPlatform.tracesEnabled=true or splunkObservability.tracesEnabled=true), either agent.enabled=true, gateway.enabled=true, or .Values.instrumentation.exporter.endpoint must be set" -}} {{- end -}} {{- /* Return the determined endpoint */ -}} @@ -81,8 +81,8 @@ Helper to define entries for instrumentation libraries. {{- $instLibAliases := dict "apache-httpd" "apacheHttpd" -}} {{- /* Iterate over each specified instrumentation library */ -}} - {{- if .Values.operator.instrumentation.spec -}} - {{- range $key, $value := .Values.operator.instrumentation.spec -}} + {{- if .Values.instrumentation -}} + {{- range $key, $value := .Values.instrumentation -}} {{- /* Check for required fields to determine if it is an instrumentation library */ -}} {{- if and (eq (kindOf $value) "map") $value.repository $value.tag -}} {{- $instLibName := get $instLibAliases $key | default $key -}} diff --git a/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml b/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml index 2ad1db8849..3d4cfea471 100644 --- a/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml +++ b/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml @@ -20,17 +20,17 @@ spec: - tracecontext - baggage - b3 - {{- with .Values.operator.instrumentation.spec.sampler }} + {{- with .Values.instrumentation.sampler }} sampler: {{- toYaml . | nindent 4 }} {{- end }} env: {{- if .Values.splunkObservability.profilingEnabled }} - {{- if eq (include "splunk-otel-collector.operator.env-has" (dict "env" .Values.operator.instrumentation.spec.env "envName" "SPLUNK_PROFILER_ENABLED")) "false" }} + {{- if eq (include "splunk-otel-collector.operator.env-has" (dict "env" .Values.instrumentation.env "envName" "SPLUNK_PROFILER_ENABLED")) "false" }} - name: SPLUNK_PROFILER_ENABLED value: "true" {{- end }} - {{- if eq (include "splunk-otel-collector.operator.env-has" (dict "env" .Values.operator.instrumentation.spec.env "envName" "SPLUNK_PROFILER_MEMORY_ENABLED")) "false" }} + {{- if eq (include "splunk-otel-collector.operator.env-has" (dict "env" .Values.instrumentation.env "envName" "SPLUNK_PROFILER_MEMORY_ENABLED")) "false" }} - name: SPLUNK_PROFILER_MEMORY_ENABLED value: "true" {{- end }} @@ -42,7 +42,7 @@ spec: apiVersion: v1 fieldPath: status.hostIP {{- end }} - {{- with .Values.operator.instrumentation.spec.env }} + {{- with .Values.instrumentation.env }} {{- toYaml . | nindent 4 }} {{- end }} {{ include "splunk-otel-collector.operator.instrumentation-libraries" . }} diff --git a/helm-charts/splunk-otel-collector/values.schema.json b/helm-charts/splunk-otel-collector/values.schema.json index ade0c4daec..66880e0252 100644 --- a/helm-charts/splunk-otel-collector/values.schema.json +++ b/helm-charts/splunk-otel-collector/values.schema.json @@ -1426,13 +1426,263 @@ "type": "object", "additionalProperties": true }, - "certmanager": { - "description": "cert-manager adds certificates and certificate issuers as resource types in Kubernetes clusters, and simplifies the process of obtaining, renewing and using those certificates.", + "opentelemetry-operator": { + "description": "OpenTelemetry Operator configuration (legacy). Prefer using 'operator' for new installations. This field is provided for backward compatibility with older Helm versions or custom distributions. A subchart that is used to install the operator, see https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/values.schema.json for more info.", "type": "object", "additionalProperties": true }, - "opentelemetry-operator": { - "description": "OpenTelemetry Operator configuration (legacy). Prefer using 'operator' for new installations. This field is provided for backward compatibility with older Helm versions or custom distributions. A subchart that is used to install the operator, see https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/values.schema.json for more info.", + "instrumentation": { + "type": "object", + "additionalProperties": false, + "properties": { + "endpoint": { + "type": "string", + "description": "Optional endpoint parameter for exporting data to a specific target." + }, + "sampler": { + "type": "object", + "description": "Optional sampler parameter for enabling trace sampling.", + "properties": { + "type": { + "type": "string" + }, + "argument": { + "type": "string" + } + }, + "additionalProperties": false + }, + "env": { + "type": "array", + "description": "Optional environment variable parameters that can configure all instrumentation libraries.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"], + "additionalProperties": false + } + }, + "java": { + "type": "object", + "description": "Configuration for Java Auto-instrumentation Library.", + "additionalProperties": false, + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "env": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"], + "additionalProperties": false + } + } + }, + "required": ["repository", "tag"] + }, + "nodejs": { + "type": "object", + "description": "Configuration for Node.js Auto-instrumentation Library.", + "additionalProperties": false, + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "env": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"], + "additionalProperties": false + } + } + }, + "required": ["repository", "tag"] + }, + "dotnet": { + "type": "object", + "description": "Configuration for .NET Auto-instrumentation Library.", + "additionalProperties": false, + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "env": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"], + "additionalProperties": false + } + } + }, + "required": ["repository", "tag"] + }, + "go": { + "type": "object", + "description": "Configuration for Go Auto-instrumentation Library.", + "additionalProperties": false, + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "env": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"], + "additionalProperties": false + } + } + }, + "required": ["repository", "tag"] + }, + "apache-httpd": { + "type": "object", + "description": "Configuration for Apache HTTPD Auto-instrumentation Library.", + "additionalProperties": false, + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "env": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"], + "additionalProperties": false + } + } + }, + "required": ["repository", "tag"] + }, + "python": { + "type": "object", + "description": "Configuration for Python Auto-instrumentation Library.", + "additionalProperties": false, + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "env": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"], + "additionalProperties": false + } + } + }, + "required": ["repository", "tag"] + }, + "nginx": { + "type": "object", + "description": "Configuration for NGINX Auto-instrumentation Library.", + "additionalProperties": false, + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "env": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"], + "additionalProperties": false + } + } + }, + "required": ["repository", "tag"] + } + } + }, + "certmanager": { + "description": "cert-manager adds certificates and certificate issuers as resource types in Kubernetes clusters, and simplifies the process of obtaining, renewing and using those certificates.", "type": "object", "additionalProperties": true }, diff --git a/helm-charts/splunk-otel-collector/values.yaml b/helm-charts/splunk-otel-collector/values.yaml index 970be49b6f..71390de2f0 100644 --- a/helm-charts/splunk-otel-collector/values.yaml +++ b/helm-charts/splunk-otel-collector/values.yaml @@ -1161,60 +1161,6 @@ service: operator: enabled: false - # For more details, refer to: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#instrumentation - instrumentation: - # Overrides for default instrumentation configurations can be specified here. - # Source: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/helm-charts/splunk-otel-collector/templates/operator/instrumentation.yaml - # Rendered Default: https://github.com/signalfx/splunk-otel-collector-chart/blob/main/examples/enable-operator-and-auto-instrumentation/rendered_manifests/operator/instrumentation.yaml - spec: - # Optional "endpoint" parameter for exporting data to a specific target. - # By default, the endpoint will be set to the agent if it's enabled. If the agent is not enabled, the endpoint - # will default to the gateway, given it is enabled. If neither the agent nor the gateway is enabled, the endpoint - # must be overridden here. - # exporter: - # endpoint: http://$(SPLUNK_OTEL_AGENT):4317 - # Optional "sampler" parameter for enabling trace sampling, see: https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_traces_sampler - # sampler: - # type: traceidratio - # argument: "0.95" - # Optional "environment variable" parameters that can configure all instrumentation libraries. - # If splunkObservability.profilingEnabled=true, environment variables enabling profiling will be added automatically. - # env: - # Auto-instrumentation Libraries (Start) - # Below are configurations for the instrumentation libraries utilized in Auto-instrumentation. - # Highlights: - # - Maturity varies among libraries (e.g., Java is more mature than Go). Check each library's stability here: https://opentelemetry.io/docs/instrumentation/#status-and-releases - # - Some libraries may be enabled by default. The current status can be checked here: https://github.com/open-telemetry/opentelemetry-operator#controlling-instrumentation-capabilities - # - Splunk provides best-effort support for native OpenTelemetry libraries, while offering full support for its own distributions. - # Each library supports the following fields: - # - repository: Specifies the Docker image repository. - # - tag: Indicates the Docker image tag. - # - env: (Optional) Allows you to add any additional environment variables. - java: - repository: ghcr.io/signalfx/splunk-otel-java/splunk-otel-java - tag: v2.7.0 - nodejs: - repository: ghcr.io/signalfx/splunk-otel-js/splunk-otel-js - tag: v2.11.0 - dotnet: - repository: ghcr.io/signalfx/splunk-otel-dotnet/splunk-otel-dotnet - tag: v1.6.0 - env: - - name: OTEL_DOTNET_AUTO_PLUGINS - value: Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation - go: - repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-go - tag: v0.10.1-alpha - apache-httpd: - repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd - tag: 1.0.4 - python: - repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python - tag: 0.44b0 - nginx: - repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd - tag: 1.0.4 - # Auto-instrumentation Libraries (End) admissionWebhooks: certManager: # Annotate the certificate and issuer to ensure they are created after the cert-manager CRDs have been installed. @@ -1225,6 +1171,87 @@ operator: "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-weight": "1" +# The default Splunk Instrumentation object deployed when operator.enabled=true. +# For more details see: +# - Splunk Documentation: https://docs.splunk.com/observability/en/gdi/opentelemetry/automatic-discovery/k8s/k8s-backend.html#optional-configure-the-instrumentation +# - OpenTelemetry Documentation: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#instrumentation +instrumentation: + # Optional "endpoint" parameter for exporting data to a specific target. + # By default, the endpoint will be set to the agent if it's enabled. If the agent is not enabled, the endpoint + # will default to the gateway, given it is enabled. If neither the agent nor the gateway is enabled, the endpoint + # must be overridden here. + endpoint: "" + # endpoint: http://$(SPLUNK_OTEL_AGENT):4317 + # endpoint: http://splunk-otel-collector:4317 + + # Optional "sampler" parameter for enabling trace sampling, see: https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_traces_sampler + sampler: {} + # type: traceidratio + # argument: "0.95" + + # Optional "environment variable" parameters that can configure all instrumentation libraries. + # - If splunkObservability.profilingEnabled=true, environment variables enabling profiling will be added automatically. + # - If the agent is used as the endpoint to receive traces, the SPLUNK_OTEL_AGENT environment variables will be added automatically. + env: [] + # - name: ENV_VAR1 + # value: value1 + # - name: ENV_VAR2 + # value: value2 + + # Auto-instrumentation Libraries + # Below are configurations for the instrumentation libraries utilized in Auto-instrumentation. + # Highlights: + # - Maturity varies among libraries (e.g., Java is more mature than Go). Check each library's stability here: https://opentelemetry.io/docs/instrumentation/#status-and-releases + # - Some libraries may be enabled by default. The current status can be checked here: https://github.com/open-telemetry/opentelemetry-operator#controlling-instrumentation-capabilities + # - Splunk provides best-effort support for native OpenTelemetry libraries, while offering full support for its own distributions. + # Each library supports the following fields: + # - repository: Specifies the Docker image repository. + # - tag: Indicates the Docker image tag. + # - env: (Optional) Allows you to add any additional environment variables. + java: + repository: ghcr.io/signalfx/splunk-otel-java/splunk-otel-java + tag: v2.7.0 + # env: + # - name: JAVA_ENV_VAR + # value: java_value + nodejs: + repository: ghcr.io/signalfx/splunk-otel-js/splunk-otel-js + tag: v2.11.0 + # env: + # - name: NODEJS_ENV_VAR + # value: nodejs_value + dotnet: + repository: ghcr.io/signalfx/splunk-otel-dotnet/splunk-otel-dotnet + tag: v1.6.0 + env: + - name: OTEL_DOTNET_AUTO_PLUGINS + value: Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + go: + repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-go + tag: v0.10.1-alpha + # env: + # - name: GO_ENV_VAR + # value: go_value + apache-httpd: + repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd + tag: 1.0.4 + # env: + # - name: APACHE_ENV_VAR + # value: apache_value + python: + repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python + tag: 0.44b0 + # env: + # - name: PYTHON_ENV_VAR + # value: python_value + nginx: + repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd + tag: 1.0.4 + # env: + # - name: NGINX_ENV_VAR + # value: nginx_value + # Auto-instrumentation Libraries (End) + # The cert-manager is a CNCF application deployed as a subchart and used for supporting operators that require TLS certificates. # Full list of Helm value configurations: https://artifacthub.io/packages/helm/cert-manager/cert-manager?modal=values certmanager: diff --git a/test/unittests/operator_customized_test.yaml b/test/unittests/operator_customized_test.yaml new file mode 100644 index 0000000000..a03e608aaa --- /dev/null +++ b/test/unittests/operator_customized_test.yaml @@ -0,0 +1,38 @@ +suite: splunk-otel-collector.operatorCustomized +templates: + - "operator/instrumentation.yaml" +values: + - ./values/operator_customized.yaml +tests: + - it: should render the Instrumentation spec correctly with default values + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.exporter.endpoint + value: http://RELEASE-NAME-splunk-otel-collector:4317 + - contains: + path: spec.env + content: + name: SPLUNK_PROFILER_ENABLED + value: "true" + - contains: + path: spec.env + content: + name: SPLUNK_PROFILER_MEMORY_ENABLED + value: "true" + - contains: + path: spec.nodejs.env + content: + name: OTEL_EXPORTER_OTLP_ENDPOINT + value: "http://$(NODEJS_OTEL_AGENT):4318" + - contains: + path: spec.nodejs.env + content: + name: SPLUNK_PROFILER_ENABLED + value: "false" + - contains: + path: spec.nodejs.env + content: + name: SPLUNK_PROFILER_MEMORY_ENABLED + value: "false" diff --git a/test/unittests/operator_default_test.yaml b/test/unittests/operator_default_test.yaml new file mode 100644 index 0000000000..79e8bf0648 --- /dev/null +++ b/test/unittests/operator_default_test.yaml @@ -0,0 +1,53 @@ +suite: splunk-otel-collector.operatorDefault +templates: + - "operator/instrumentation.yaml" +values: + - ./values/operator_default.yaml +tests: + - it: should render the Instrumentation spec correctly with default values + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.exporter.endpoint + value: http://$(SPLUNK_OTEL_AGENT):4317 + - contains: + path: spec.propagators + content: tracecontext + - contains: + path: spec.propagators + content: baggage + - contains: + path: spec.propagators + content: b3 + - contains: + path: spec.env + content: + name: SPLUNK_OTEL_AGENT + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.hostIP + - contains: + path: spec.dotnet.env + content: + name: OTEL_DOTNET_AUTO_PLUGINS + value: Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + - contains: + path: spec.dotnet.env + content: + name: OTEL_EXPORTER_OTLP_ENDPOINT + value: http://$(SPLUNK_OTEL_AGENT):4318 + - contains: + path: spec.env + content: + name: SPLUNK_OTEL_AGENT + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.hostIP + - contains: + path: spec.java.env + content: + name: OTEL_EXPORTER_OTLP_ENDPOINT + value: http://$(SPLUNK_OTEL_AGENT):4318 diff --git a/test/unittests/values/operator_customized.yaml b/test/unittests/values/operator_customized.yaml new file mode 100644 index 0000000000..743c597fd7 --- /dev/null +++ b/test/unittests/values/operator_customized.yaml @@ -0,0 +1,27 @@ +clusterName: test-gateway +splunkObservability: + realm: test + accessToken: test + # Should update instrumentation.env to include SPLUNK_PROFILER_ENABLED="true" and SPLUNK_PROFILER_MEMORY_ENABLED="true" + profilingEnabled: true +environment: test +agent: + enabled: false +gateway: + enabled: true +operator: + enabled: true +certmanager: + enabled: true +instrumentation: + sampler: + type: traceidratio + argument: "0.95" + nodejs: + env: + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: http://$(NODEJS_OTEL_AGENT):4318 + - name: SPLUNK_PROFILER_ENABLED + value: "false" + - name: SPLUNK_PROFILER_MEMORY_ENABLED + value: "false" diff --git a/test/unittests/values/operator_default.yaml b/test/unittests/values/operator_default.yaml new file mode 100644 index 0000000000..c271d4842a --- /dev/null +++ b/test/unittests/values/operator_default.yaml @@ -0,0 +1,9 @@ +clusterName: test +splunkObservability: + realm: test + accessToken: test +environment: test +operator: + enabled: true +certmanager: + enabled: true