Skip to content

Commit

Permalink
[chore] Improve Auto-instrumentation Configurations (#1166)
Browse files Browse the repository at this point in the history
* Make auto-instrumented applications use global service endpoints instead of namespace service endpoints

* Improve adding env var SPLUNK_OTEL_AGENT to otelinst only when needed
  • Loading branch information
jvoravong authored Feb 15, 2024
1 parent bbb9de5 commit cc80d17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Helper to ensure the correct usage of the Splunk OpenTelemetry Collector Operato
{{/*
Helper to define an endpoint for exporting telemetry data related to auto-instrumentation.
- Determines the endpoint based on user-defined values or default agent/gateway settings.
- Order of precedence: User-defined > Agent service endpoint > Agent host port endpoint > Gateway endpoint
- Order of precedence: User-defined endpoint > Agent service endpoint > Agent host port endpoint > Gateway endpoint
*/}}
{{- define "splunk-otel-collector.operator.instrumentation-exporter-endpoint" -}}
{{- /* Initialize endpoint variable */ -}}
Expand All @@ -48,7 +48,7 @@ Helper to define an endpoint for exporting telemetry data related to auto-instru
{{- $endpoint = .Values.operator.instrumentation.spec.exporter.endpoint -}}
{{- /* Use the agent service endpoint if the agent is enabled */ -}}
{{- else if .Values.agent.service.enabled -}}
{{- $endpoint = printf "http://%s-agent:4317" (include "splunk-otel-collector.fullname" .) -}}
{{- $endpoint = printf "http://%s-agent.%s.svc.cluster.local:4317" (include "splunk-otel-collector.fullname" .) .Release.Namespace -}}
{{- /* Use the agent host port endpoint if the agent is enabled */ -}}
{{- else if .Values.agent.enabled -}}
{{- $endpoint = "http://$(SPLUNK_OTEL_AGENT):4317" -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
value: "true"
{{- end }}
{{- end }}
{{- if .Values.agent.enabled }}
{{- if contains "SPLUNK_OTEL_AGENT" (include "splunk-otel-collector.operator.instrumentation-exporter-endpoint" .) }}
- name: SPLUNK_OTEL_AGENT
valueFrom:
fieldRef:
Expand Down

0 comments on commit cc80d17

Please sign in to comment.