Skip to content

Commit

Permalink
Merge pull request #780 from solarwinds/feature/NH-94277-fix
Browse files Browse the repository at this point in the history
NH-94277: fixing scrape of etcd and controller manager with autodiscovery disabled
  • Loading branch information
juraj-paska authored Nov 6, 2024
2 parents 20a5f6a + a5b4eff commit c47eaa4
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 59 deletions.
2 changes: 1 addition & 1 deletion deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: swo-k8s-collector
version: 4.2.0-alpha.8
version: 4.2.0-alpha.9
appVersion: 0.11.7
description: SolarWinds Kubernetes Integration
keywords:
Expand Down
7 changes: 5 additions & 2 deletions deploy/helm/node-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ receivers:
{{- end }}
{{- end }}
{{- end }}
{{- end }}

{{- if .Values.otel.metrics.control_plane.controller_manager.enabled }}
prometheus/controller-manager:
Expand All @@ -677,6 +678,7 @@ receivers:
metrics_path: {{ quote .Values.otel.metrics.control_plane.controller_manager.metrics_path }}
honor_timestamps: false
honor_labels: true
{{- if eq .Values.otel.metrics.control_plane.controller_manager.scheme "https" }}
authorization:
type: Bearer
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
Expand All @@ -685,6 +687,7 @@ receivers:
insecure_skip_verify: true
follow_redirects: true
enable_http2: true
{{- end }}
static_configs:
- targets:
- '`endpoint`:{{ .Values.otel.metrics.control_plane.controller_manager.port }}'
Expand All @@ -702,6 +705,7 @@ receivers:
metrics_path: {{ quote .Values.otel.metrics.control_plane.etcd.metrics_path }}
honor_timestamps: false
honor_labels: true
{{- if eq .Values.otel.metrics.control_plane.etcd.scheme "https" }}
authorization:
type: Bearer
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
Expand All @@ -710,12 +714,11 @@ receivers:
insecure_skip_verify: true
follow_redirects: true
enable_http2: true
{{- end }}
static_configs:
- targets:
- '`endpoint`:{{ .Values.otel.metrics.control_plane.etcd.port }}'
{{- end }}

{{- end }}
{{- end }}

{{- if and .Values.otel.metrics.enabled (not .Values.aws_fargate.enabled) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,12 +1035,7 @@ Node collector config for windows nodes should match snapshot when using default
config:
config:
scrape_configs:
- authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
type: Bearer
enable_http2: true
follow_redirects: true
honor_labels: true
- honor_labels: true
honor_timestamps: false
job_name: kubernetes-etcd
metrics_path: /metrics
Expand All @@ -1049,9 +1044,6 @@ Node collector config for windows nodes should match snapshot when using default
static_configs:
- targets:
- '`endpoint`:2379'
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
rule: type == "pod" && labels["component"] == "etcd"
watch_observers:
- k8s_observer
Expand Down Expand Up @@ -2293,12 +2285,7 @@ Node collector config for windows nodes should match snapshot when using legacy
config:
config:
scrape_configs:
- authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
type: Bearer
enable_http2: true
follow_redirects: true
honor_labels: true
- honor_labels: true
honor_timestamps: false
job_name: kubernetes-etcd
metrics_path: /metrics
Expand All @@ -2307,9 +2294,6 @@ Node collector config for windows nodes should match snapshot when using legacy
static_configs:
- targets:
- '`endpoint`:2379'
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
rule: type == "pod" && labels["component"] == "etcd"
watch_observers:
- k8s_observer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,12 +1058,7 @@ Custom logs filter with new syntax:
config:
config:
scrape_configs:
- authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
type: Bearer
enable_http2: true
follow_redirects: true
honor_labels: true
- honor_labels: true
honor_timestamps: false
job_name: kubernetes-etcd
metrics_path: /metrics
Expand All @@ -1072,9 +1067,6 @@ Custom logs filter with new syntax:
static_configs:
- targets:
- '`endpoint`:2379'
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
rule: type == "pod" && labels["component"] == "etcd"
watch_observers:
- k8s_observer
Expand Down Expand Up @@ -2353,12 +2345,7 @@ Custom logs filter with old syntax:
config:
config:
scrape_configs:
- authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
type: Bearer
enable_http2: true
follow_redirects: true
honor_labels: true
- honor_labels: true
honor_timestamps: false
job_name: kubernetes-etcd
metrics_path: /metrics
Expand All @@ -2367,9 +2354,6 @@ Custom logs filter with old syntax:
static_configs:
- targets:
- '`endpoint`:2379'
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
rule: type == "pod" && labels["component"] == "etcd"
watch_observers:
- k8s_observer
Expand Down Expand Up @@ -3491,7 +3475,43 @@ Node collector config should match snapshot when autodiscovery is disabled:
- docker
- containerd
receiver_creator/discovery:
receivers: null
receivers:
prometheus/controller-manager:
config:
config:
scrape_configs:
- authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
type: Bearer
enable_http2: true
follow_redirects: true
honor_labels: true
honor_timestamps: false
job_name: kubernetes-controller-manager
metrics_path: /metrics
scheme: https
scrape_interval: 60s
static_configs:
- targets:
- '`endpoint`:10257'
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
rule: type == "pod" && labels["component"] == "kube-controller-manager"
prometheus/etcd:
config:
config:
scrape_configs:
- honor_labels: true
honor_timestamps: false
job_name: kubernetes-etcd
metrics_path: /metrics
scheme: http
scrape_interval: 60s
static_configs:
- targets:
- '`endpoint`:2379'
rule: type == "pod" && labels["component"] == "etcd"
watch_observers:
- k8s_observer
receiver_creator/node:
Expand Down Expand Up @@ -4662,12 +4682,7 @@ Node collector config should match snapshot when fargate is enabled:
config:
config:
scrape_configs:
- authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
type: Bearer
enable_http2: true
follow_redirects: true
honor_labels: true
- honor_labels: true
honor_timestamps: false
job_name: kubernetes-etcd
metrics_path: /metrics
Expand All @@ -4676,9 +4691,6 @@ Node collector config should match snapshot when fargate is enabled:
static_configs:
- targets:
- '`endpoint`:2379'
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
rule: type == "pod" && labels["component"] == "etcd"
watch_observers:
- k8s_observer
Expand Down Expand Up @@ -5730,7 +5742,43 @@ Node collector config should match snapshot when fargate is enabled and autodisc
- docker
- containerd
receiver_creator/discovery:
receivers: null
receivers:
prometheus/controller-manager:
config:
config:
scrape_configs:
- authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
type: Bearer
enable_http2: true
follow_redirects: true
honor_labels: true
honor_timestamps: false
job_name: kubernetes-controller-manager
metrics_path: /metrics
scheme: https
scrape_interval: 60s
static_configs:
- targets:
- '`endpoint`:10257'
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
rule: type == "pod" && labels["component"] == "kube-controller-manager"
prometheus/etcd:
config:
config:
scrape_configs:
- honor_labels: true
honor_timestamps: false
job_name: kubernetes-etcd
metrics_path: /metrics
scheme: http
scrape_interval: 60s
static_configs:
- targets:
- '`endpoint`:2379'
rule: type == "pod" && labels["component"] == "etcd"
watch_observers:
- k8s_observer
service:
Expand Down Expand Up @@ -6832,12 +6880,7 @@ Node collector config should match snapshot when using default values:
config:
config:
scrape_configs:
- authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
type: Bearer
enable_http2: true
follow_redirects: true
honor_labels: true
- honor_labels: true
honor_timestamps: false
job_name: kubernetes-etcd
metrics_path: /metrics
Expand All @@ -6846,9 +6889,6 @@ Node collector config should match snapshot when using default values:
static_configs:
- targets:
- '`endpoint`:2379'
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
rule: type == "pod" && labels["component"] == "etcd"
watch_observers:
- k8s_observer
Expand Down

0 comments on commit c47eaa4

Please sign in to comment.