Skip to content

Commit 5f3a421

Browse files
authored
allow control plane metrics from all distro (#1760)
* allow control plane metrics from all distro * update issue
1 parent c28f558 commit 5f3a421

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

.chloggen/controlplaneMetrics.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
3+
# The name of the component, or a single word describing the area of concern, (e.g. agent, clusterReceiver, gateway, operator, chart, other)
4+
component: agent
5+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
6+
note: Allow featureGates.useControlPlaneMetricsHistogramData to work with any distribution of k8s cluster.
7+
# One or more tracking issues related to the change
8+
issues: [1760]
9+
# (Optional) One or more lines of additional information to render under the primary note.
10+
# These lines will be padded with 2 spaces and then inserted directly into the document.
11+
# Use pipe (|) for multiline entries.
12+
subtext: |
13+
Users can enable agent.controlPlaneMetrics for k8s components which run on worker nodes
14+
such as kubedns (gke), coredns (aks, eks) and kube-proxy (eks) with the feature gate
15+
featureGates.useControlPlaneMetricsHistogramData set to true.
16+
To disable collection of metrics from specific control plane components, set the corresponding
17+
component to false in the agent.controlPlaneMetrics configuration. For example:
18+
agent:
19+
controlPlaneMetrics:
20+
coredns:
21+
enabled: false
22+
proxy:
23+
enabled: false

helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,21 @@ receivers:
233233

234234
{{- if and (eq (include "splunk-otel-collector.splunkO11yEnabled" .) "true") .Values.featureGates.useControlPlaneMetricsHistogramData }}
235235
# Receivers for collecting k8s control plane metrics as native OpenTelemetry metrics, including histogram data.
236-
{{- if or (eq .Values.distribution "openshift") (eq .Values.distribution "") }}
237236
# Below, the TLS certificate verification is often skipped because the k8s default certificate is self signed and
238237
# will fail the verification.
239238
{{- if .Values.agent.controlPlaneMetrics.coredns.enabled }}
239+
{{- if eq .Values.distribution "gke"}}
240+
prometheus/kubedns:
241+
rule: type == "pod" && labels["k8s-app"] == "kube-dns"
242+
config:
243+
config:
244+
scrape_configs:
245+
- job_name: "kubedns"
246+
static_configs:
247+
- targets: ['`endpoint`:`"prometheus.io/port" in annotations ? annotations["prometheus.io/port"] : 9153`']
248+
tls_config:
249+
insecure_skip_verify: true
250+
{{- else }}
240251
prometheus/coredns:
241252
{{- if eq .Values.distribution "openshift" }}
242253
rule: type == "pod" && namespace == "openshift-dns" && name contains "dns"
@@ -257,6 +268,7 @@ receivers:
257268
- targets: ["`endpoint`:9153"]
258269
{{- end }}
259270
{{- end }}
271+
{{- end }}
260272
{{- if .Values.agent.controlPlaneMetrics.etcd.enabled }}
261273
prometheus/etcd:
262274
{{- if eq .Values.distribution "openshift" }}
@@ -360,7 +372,6 @@ receivers:
360372
credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
361373
type: Bearer
362374
{{- end }}
363-
{{- end }}
364375
{{- end }}
365376

366377
kubeletstats:

helm-charts/splunk-otel-collector/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ agent:
311311
enabled: true
312312
coredns:
313313
# Specifies whether to collect coredns metrics.
314+
# Note - when using GKE, and this is enabled, the chart will create a
315+
# receiver for kubedns instead of coredns.
314316
enabled: true
315317
etcd:
316318
# Specifies whether to collect etcd metrics.
@@ -344,6 +346,8 @@ agent:
344346
skipVerify: true
345347
proxy:
346348
# Specifies whether to collect proxy metrics.
349+
# Note - the prometheus receiver introduced for this component might match
350+
# kube-proxy deployed in managed k8s cluster like EKS.
347351
enabled: true
348352
scheduler:
349353
# Specifies whether to collect scheduler metrics.

0 commit comments

Comments
 (0)