Skip to content

Commit 3c8103b

Browse files
authored
Merge pull request prometheus-operator#1543 from arajkumar/add-thanos-targetgroup
2 parents 9b532da + 1ff5273 commit 3c8103b

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

jsonnet/kube-prometheus/components/prometheus.libsonnet

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ local defaults = {
3434
_config: {
3535
prometheusSelector: 'job="prometheus-' + defaults.name + '",namespace="' + defaults.namespace + '"',
3636
prometheusName: '{{$labels.namespace}}/{{$labels.pod}}',
37-
thanosSelector: 'job="thanos-sidecar"',
37+
// TODO: remove `thanosSelector` after 0.10.0 release.
38+
thanosSelector: '',
39+
thanos: {
40+
targetGroups: {
41+
namespace: defaults.namespace,
42+
},
43+
sidecar: {
44+
selector: 'job="thanos-sidecar"',
45+
thanosPrometheusCommonDimensions: 'namespace, pod',
46+
},
47+
},
3848
runbookURLPattern: 'https://runbooks.prometheus-operator.dev/runbooks/prometheus/%s',
3949
},
4050
},
@@ -65,12 +75,9 @@ function(params) {
6575
(import 'github.com/thanos-io/thanos/mixin/alerts/sidecar.libsonnet') +
6676
(import 'github.com/kubernetes-monitoring/kubernetes-mixin/lib/add-runbook-links.libsonnet') + {
6777
_config+:: p._config.mixin._config,
68-
targetGroups: {},
69-
sidecar: {
70-
selector: p._config.mixin._config.thanosSelector,
71-
thanosPrometheusCommonDimensions: 'namespace, pod',
72-
dimensions: std.join(', ', ['job', 'instance']),
73-
},
78+
targetGroups+: p._config.mixin._config.thanos.targetGroups,
79+
// TODO: remove `_config.thanosSelector` after 0.10.0 release.
80+
sidecar+: { selector: p._config.mixin._config.thanosSelector } + p._config.mixin._config.thanos.sidecar,
7481
},
7582

7683
prometheusRule: {

0 commit comments

Comments
 (0)