Skip to content

Commit 88a04ac

Browse files
authored
Merge pull request #284 from grafana/beorn7/prom-ha
Add __replica__ labels to prometheus-ha replicas
2 parents 4cfedad + 23ea54e commit 88a04ac

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

prometheus-ksonnet/lib/prometheus-ha-mixin.libsonnet

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,27 @@ local configMap = k.core.v1.configMap;
1010
prometheus_config_file: '/etc/$(POD_NAME)/prometheus.yml',
1111
},
1212

13+
// The '__replica__' label is used by Cortex for deduplication.
1314
prometheus_zero+:: {
14-
config+:: root.prometheus_config,
15+
config+:: root.prometheus_config {
16+
global+: {
17+
external_labels+: {
18+
__replica__: 'zero',
19+
},
20+
},
21+
},
1522
alerts+:: root.prometheusAlerts,
1623
rules+:: root.prometheusRules,
1724
},
1825

1926
prometheus_one+:: {
20-
config+:: root.prometheus_config,
27+
config+:: root.prometheus_config {
28+
global+: {
29+
external_labels+: {
30+
__replica__: 'one',
31+
},
32+
},
33+
},
2134
alerts+:: root.prometheusAlerts,
2235
rules+:: root.prometheusRules,
2336
},

0 commit comments

Comments
 (0)