Skip to content

Commit 40464aa

Browse files
authored
prometheus: drop labels with duplicate nodename entries (#209)
1 parent 2f46069 commit 40464aa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

charts/sourcegraph/templates/prometheus/prometheus.ConfigMap.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ data:
176176
- source_labels: [__meta_kubernetes_endpoint_node_name]
177177
action: replace
178178
target_label: nodename
179+
metric_relabel_configs:
180+
# Sourcegraph specific customization. Drop metrics with empty nodename responses from the k8s API
181+
- source_labels: [nodename]
182+
regex: ^$
183+
action: drop
179184
180185
# Example scrape config for probing services via the Blackbox Exporter.
181186
#
@@ -249,7 +254,7 @@ data:
249254
target_label: ns
250255
# Sourcegraph specific customization. We want to add a label to every
251256
# metric that indicates the node it came from.
252-
- source_labels: [__meta_kubernetes_endpoint_node_name]
257+
- source_labels: [__meta_kubernetes_pod_node_name]
253258
action: replace
254259
target_label: nodename
255260
@@ -272,6 +277,10 @@ data:
272277
action: replace
273278
target_label: name
274279
separator: '-'
280+
# Sourcegraph specific customization. Drop metrics with empty nodename responses from the k8s API
281+
- source_labels: [nodename]
282+
regex: ^$
283+
action: drop
275284
276285
# Scrape prometheus itself for metrics.
277286
- job_name: 'builtin-prometheus'

0 commit comments

Comments
 (0)