Skip to content

Commit

Permalink
Change the bind address for the otel collector and the health check e…
Browse files Browse the repository at this point in the history
…xt to the pod IP
  • Loading branch information
rnishtala-sumo committed Aug 20, 2024
1 parent 726cf73 commit 2290367
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 26 deletions.
3 changes: 2 additions & 1 deletion deploy/helm/sumologic/conf/events/otelcol/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ extensions:
directory: {{ .Values.sumologic.events.persistence.persistentVolume.path }}
timeout: 10s
{{- end }}
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
pprof: {}

processors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,27 @@ receivers:
jaeger:
protocols:
thrift_compact:
endpoint: "0.0.0.0:6831"
endpoint: "${env:MY_POD_IP}:6831"
thrift_binary:
endpoint: "0.0.0.0:6832"
endpoint: "${env:MY_POD_IP}:6832"
grpc:
endpoint: "0.0.0.0:14250"
endpoint: "${env:MY_POD_IP}:14250"
thrift_http:
endpoint: "0.0.0.0:14268"
endpoint: "${env:MY_POD_IP}:14268"
opencensus:
endpoint: "0.0.0.0:55678"
endpoint: "${env:MY_POD_IP}:55678"
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:4317"
endpoint: "${env:MY_POD_IP}:4317"
http:
endpoint: "0.0.0.0:4318"
endpoint: "${env:MY_POD_IP}:4318"
otlp/deprecated:
protocols:
http:
endpoint: "0.0.0.0:55681"
endpoint: "${env:MY_POD_IP}:55681"
zipkin:
endpoint: "0.0.0.0:9411"
endpoint: "${env:MY_POD_IP}:9411"

processors:
## Source processor adds Sumo Logic related metadata
Expand Down Expand Up @@ -173,7 +173,8 @@ processors:
## Time duration after which a batch will be sent regardless of size
timeout: 5s
extensions:
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
memory_ballast:
## Memory Ballast size should be max 1/3 to 1/2 of memory.
size_mib: 512
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ receivers:
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:4317"
endpoint: "${env:MY_POD_IP}:4317"
http:
endpoint: "0.0.0.0:4318"
endpoint: "${env:MY_POD_IP}:4318"
processors:
## The memory_limiter processor is used to prevent out of memory situations on the collector.
memory_limiter:
Expand Down Expand Up @@ -55,7 +55,8 @@ processors:
## Never more than this many spans are being sent in a batch
# send_batch_max_size: 512
extensions:
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
memory_ballast:
## Memory Ballast size should be max 1/3 to 1/2 of memory.
size_mib: 512
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ receivers:
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:4317"
endpoint: "${env:MY_POD_IP}:4317"
http:
endpoint: "0.0.0.0:4318"
endpoint: "${env:MY_POD_IP}:4318"
processors:
## The memory_limiter processor is used to prevent out of memory situations on the collector.
memory_limiter:
Expand Down Expand Up @@ -70,7 +70,8 @@ processors:
timeout: 5s

extensions:
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
{{- if .Values.tracesSampler.persistence.enabled }}
## Configuration for File Storage extension
file_storage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ extensions:
directory: /var/lib/storage/otc
timeout: 10s
{{ end }}
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
pprof: {}

processors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ extensions:
on_rebound: true
directory: /var/lib/storage/otc
timeout: 10s
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
pprof: {}

processors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ extensions:
on_rebound: true
directory: /var/lib/storage/otc
timeout: 10s
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
pprof: {}

processors:
Expand Down
5 changes: 3 additions & 2 deletions deploy/helm/sumologic/conf/logs/otelcol/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ exporters:
{{- end }}

extensions:
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
{{ if .Values.metadata.persistence.enabled }}
## Configuration for File Storage extension
file_storage:
Expand Down Expand Up @@ -509,7 +510,7 @@ receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
endpoint: ${env:MY_POD_IP}:4318
{{ end }}

service:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ exporters:
disable_keep_alives: true

extensions:
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
pprof: {}
file_storage:
directory: /var/lib/storage/otc
Expand Down Expand Up @@ -199,7 +200,7 @@ service:
logs:
level: {{ .Values.metadata.metrics.logLevel }}
metrics:
address: 0.0.0.0:8888 # this is the default, but setting it explicitly lets the operator add it automatically
address: ${env:MY_POD_IP}:8888 # this is the default, but setting it explicitly lets the operator add it automatically
extensions:
- health_check
- pprof
Expand Down
5 changes: 3 additions & 2 deletions deploy/helm/sumologic/conf/metrics/otelcol/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ extensions:
directory: /var/lib/storage/otc
timeout: 10s
{{ end }}
health_check: {}
health_check:
endpoint: ${env:MY_POD_IP}:13133
pprof: {}

processors:
Expand Down Expand Up @@ -40,7 +41,7 @@ receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
endpoint: ${env:MY_POD_IP}:4318

service:
extensions:
Expand Down
8 changes: 8 additions & 0 deletions deploy/helm/sumologic/templates/_helpers/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,14 @@ Example Usage:
{{- end -}}
{{- end -}}

{{- define "pod-ip" -}}
- name: MY_POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
{{- end -}}

{{/*
Pod anti affinity "hard"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ spec:
{{- $ctx := .Values -}}
{{- include "kubernetes.sources.envs" (dict "Context" $ctx "Type" "events") | nindent 8 -}}
{{- include "proxy-env-variables" . | nindent 8 -}}
{{- include "pod-ip" . | nindent 8 -}}
{{- if .Values.otelevents.statefulset.extraEnvVars }}
{{ toYaml .Values.otelevents.statefulset.extraEnvVars | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ spec:
env:
{{- $ctx := .Values -}}
{{- include "kubernetes.sources.env" (dict "Context" $ctx "Type" "metrics" "Name" "default" ) | nindent 8 -}}
{{- include "pod-ip" . | nindent 8 -}}
{{- if $otelcolInstrumentation.statefulset.extraEnvVars }}
{{- toYaml $otelcolInstrumentation.statefulset.extraEnvVars | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ spec:
{{- include "kubernetes.sources.envs" (dict "Context" $ctx "Type" "traces") | nindent 8 -}}
{{- include "kubernetes.sources.env" (dict "Context" $ctx "Type" "metrics" "Name" "default" ) | nindent 8 }}
{{- include "proxy-env-variables" . | nindent 8 -}}
{{- include "pod-ip" . | nindent 8 -}}
{{- if $tracesGateway.deployment.extraEnvVars }}
{{- toYaml $tracesGateway.deployment.extraEnvVars | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ spec:
{{- $ctx := .Values -}}
{{- include "kubernetes.sources.envs" (dict "Context" $ctx "Type" "traces") | nindent 8 -}}
{{- include "proxy-env-variables" . | nindent 8 -}}
{{- include "pod-ip" . | nindent 8 -}}
{{- if $tracesSampler.deployment.extraEnvVars }}
{{- toYaml $tracesSampler.deployment.extraEnvVars | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "pod-ip" . | nindent 8 -}}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "pod-ip" . | nindent 8 -}}
{{- if $daemonset.extraEnvVars }}
{{ toYaml $daemonset.extraEnvVars | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "pod-ip" . | nindent 8 -}}
{{- if $daemonset.extraEnvVars }}
{{ toYaml $daemonset.extraEnvVars | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ spec:
{{- $ctx := .Values -}}
{{- include "kubernetes.sources.envs" (dict "Context" $ctx "Type" "logs") | nindent 8 -}}
{{- include "proxy-env-variables" . | nindent 8 -}}
{{- include "pod-ip" . | nindent 8 -}}
{{- if .Values.metadata.logs.statefulset.extraEnvVars }}
{{- toYaml .Values.metadata.logs.statefulset.extraEnvVars | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ spec:
{{- $ctx := .Values -}}
{{- include "kubernetes.sources.envs" (dict "Context" $ctx "Type" "metrics") | nindent 8 -}}
{{- include "proxy-env-variables" . | nindent 8 -}}
{{- include "pod-ip" . | nindent 8 -}}
{{- if .Values.metadata.metrics.statefulset.extraEnvVars }}
{{ toYaml .Values.metadata.metrics.statefulset.extraEnvVars | nindent 8 }}
{{- end }}
Expand Down

0 comments on commit 2290367

Please sign in to comment.