Skip to content

Commit 8691d49

Browse files
send sidecar metrics to observe directly
1 parent 9a8b9dc commit 8691d49

File tree

9 files changed

+37
-524
lines changed

9 files changed

+37
-524
lines changed

charts/agent/Chart.lock

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,5 @@ dependencies:
2020
- name: opentelemetry-collector
2121
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
2222
version: 0.130.2
23-
- name: opentelemetry-operator
24-
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
25-
version: 0.93.1
26-
digest: sha256:b5548207946689a925841cca60cf59984043d00886dcb93b407c144630af909f
27-
generated: "2025-09-29T16:49:24.216039-07:00"
23+
digest: sha256:1463a6ca81d2cffd7c7cdf60a8bbc1f490ca721a50328f17a9b1f8d06a1dc6b1
24+
generated: "2025-10-01T13:00:21.618875-07:00"

charts/agent/Chart.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ dependencies:
4040
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
4141
alias: gateway
4242
condition: gatewayDeployment.enabled
43-
- name: opentelemetry-operator
44-
version: 0.93.1
45-
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
46-
alias: fargate-sidecar-injector
47-
condition: node.fargateMode
4843
maintainers:
4944
- name: Observe
5045

charts/agent/templates/_config-receivers.tpl

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -137,26 +137,3 @@ prometheus/cadvisor:
137137
replacement: /api/v1/nodes/$$1/proxy/metrics/cadvisor
138138
{{ end }}
139139
{{ end }}
140-
141-
{{- define "config.receivers.prometheus.kubeletstats" -}}
142-
prometheus/kubeletstats:
143-
config:
144-
scrape_configs:
145-
- job_name: 'kubernetes-nodes-kubeletstats'
146-
scheme: https
147-
tls_config:
148-
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
149-
insecure_skip_verify: true
150-
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
151-
152-
kubernetes_sd_configs:
153-
- role: node
154-
155-
relabel_configs:
156-
- target_label: __address__
157-
replacement: kubernetes.default.svc:443
158-
- source_labels: [__meta_kubernetes_node_name]
159-
regex: (.+)
160-
target_label: __metrics_path__
161-
replacement: /api/v1/nodes/$$1/proxy/stats/summary
162-
{{- end -}}

charts/agent/templates/_kubeletstats-sidecar.tpl

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{{- define "observe.sidecar.fargateSidecarMetrics.config" -}}
22

3-
{{- $kubeletstatsExporters := (list "otlphttp" "debug") -}}
4-
53
receivers:
64
kubeletstats:
75
collection_interval: {{.Values.node.containers.metrics.interval}}
@@ -57,17 +55,29 @@ receivers:
5755
extra_metadata_labels:
5856
- container.id
5957

58+
processors:
59+
60+
{{- include "config.processors.memory_limiter" . | nindent 2 }}
61+
{{- include "config.processors.batch" . | nindent 2 }}
62+
{{- include "config.processors.resource_detection.cloud" . | nindent 2 }}
63+
{{- include "config.processors.attributes.k8sattributes" . | nindent 2 }}
64+
{{- include "config.processors.resource.observe_common" . | nindent 2 }}
65+
{{- include "config.processors.deltatocumulative" . | nindent 2 }}
66+
{{- include "config.processors.attributes.add_empty_service_attributes" . | nindent 2 }}
67+
{{- include "config.processors.metricstransform.duplicate_k8s_cpu_metrics" . | nindent 2 }}
68+
{{- include "config.processors.attributes.sidecar_kubeletstats_metrics" . | nindent 2 }}
69+
6070
exporters:
61-
otlphttp:
62-
endpoint: http://observe-agent-forwarder.observe.svc:4318
6371
debug:
6472
verbosity: detailed
73+
{{- include "config.exporters.prometheusremotewrite" . | nindent 2 }}
74+
75+
{{ $kubeletstatsExporters := (list "debug" "prometheusremotewrite/observe") -}}
6576

6677
service:
6778
pipelines:
68-
{{- if .Values.node.containers.metrics.enabled }}
69-
metrics/kubeletstats:
70-
receivers: [kubeletstats] # should add processors back eventually
71-
exporters: [{{ join ", " $kubeletstatsExporters }}]
72-
{{- end -}}
73-
{{- end }}
79+
metrics/kubeletstats:
80+
receivers: [kubeletstats]
81+
processors: [memory_limiter, metricstransform/duplicate_k8s_cpu_metrics, k8sattributes, deltatocumulative/observe, batch, resourcedetection/cloud, resource/observe_common, attributes/debug_source_sidecar_kubeletstats_metrics]
82+
exporters: [{{ join ", " $kubeletstatsExporters }}]
83+
{{- end }}

charts/agent/templates/kubeletstats-sidecar.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
1-
{{- if .Values.node.fargateSidecar.enabled }}
1+
{{- if .Values.node.fargateMode }}
22
apiVersion: opentelemetry.io/v1beta1
33
kind: OpenTelemetryCollector
44
metadata:
55
name: fargate-sidecar-metrics
66
spec:
77
mode: sidecar
8+
image: "ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest"
89
env:
910
- name: K8S_NODE_NAME
1011
valueFrom:
1112
fieldRef:
1213
fieldPath: spec.nodeName
14+
- name: OBSERVE_CLUSTER_NAME
15+
value: "{{ .Values.cluster.name }}"
16+
- name: OBSERVE_CLUSTER_UID
17+
valueFrom:
18+
configMapKeyRef:
19+
name: cluster-info
20+
key: id
21+
- name: OBSERVE_PROMETHEUS_ENDPOINT
22+
value: "{{ .Values.observe.collectionEndpoint.value }}v1/prometheus"
23+
- name: OBSERVE_AUTHORIZATION_HEADER
24+
value: "Bearer {{ .Values.observe.token.value }}"
1325
config:
1426
{{- include "observe.sidecar.applyFargateSidecarMetricsConfig" . | nindent 4 }}
1527
initContainers:

charts/agent/values.yaml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ node:
4747
# -- Enables the node-logs-metrics agent daemonset for collection of node logs and metrics.
4848
# The nodes on which metrics and logs are collected can be configured via `affinity` in the `node-logs-metrics` section below.
4949
# This should be set to false to disable the node-log-metrics daemonset when running in a serverless environment (ex: EKS Fargate).
50-
enabled: false
50+
enabled: true
5151
fargateMode: false
5252
# collects host level metrics from node
5353
metrics:
@@ -101,7 +101,6 @@ node:
101101
# this resolves issues similar to https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26481#issuecomment-1720797914 for `no such host` or `connection refused`.
102102
useNodeIp: false
103103
forwarder:
104-
mode: deployment
105104
enabled: true
106105
traces:
107106
enabled: true
@@ -231,10 +230,6 @@ agent:
231230
# exporters:
232231
# - otlphttp/extra
233232
# - otlphttp/observe/forward/trace
234-
235-
# -- Additional OTel collector config for fargate-sidecar-metrics custom resource
236-
fargateSidecarMetrics:
237-
# Put any OTel config overrides here.
238233

239234
# -- Additional OTel collector config for gateway deployment
240235
gateway:
@@ -957,7 +952,7 @@ monitor:
957952
forwarder:
958953
# -- The forwarder is run as a daemonset by default, but can be run as a deployment by setting mode to "deployment". Deployment mode
959954
# must be used when running in a serverless environment (ex: EKS Fargate) where daemonsets are not supported.
960-
mode: deployment
955+
mode: daemonset
961956

962957
# -- The `replicaCount` is only used when `mode` is set to "deployment". It is ignored when `mode` is set to "daemonset".
963958
# In deployment mode, this sets the number of replicas (ie the number of forwarder pods to run).
@@ -1253,25 +1248,3 @@ gateway:
12531248
# ----------------------------------------- #
12541249
image:
12551250
repository: "otel/opentelemetry-collector-k8s"
1256-
1257-
1258-
fargate-sidecar-injector:
1259-
1260-
# -- This is an otel operator that will inject a sidecar container into all pods in the cluster. This is only needed when running
1261-
# in a serverless environment (ex: EKS Fargate) where daemonsets are not supported.
1262-
1263-
replicaCount: 1
1264-
1265-
# ----------------------------------------- #
1266-
# Different for each deployment/daemonset #
1267-
nameOverride: "fargate-sidecar-injector"
1268-
# !!! IMPORTANT !!! This needs to have same value as namespaceOverride in cluster above
1269-
namespaceOverride: "observe"
1270-
# for now, use defaults for the rest of the values
1271-
# ----------------------------------------- #
1272-
manager:
1273-
collectorImage:
1274-
repository: observeinc/observe-agent
1275-
tag: 2.8.1
1276-
1277-

cluster_role.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

forwarder-deploy.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)