Skip to content

Commit c070408

Browse files
authored
Merge pull request #135 from thanos-io/pod-reference-instance
*: Relabel pod reference into instance label
2 parents 369abbd + e9824df commit c070408

12 files changed

+82
-5
lines changed

examples/all/manifests/thanos-compact-serviceMonitor.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ metadata:
1111
spec:
1212
endpoints:
1313
- port: http
14+
relabelings:
15+
- separator: /
16+
sourceLabels:
17+
- namespace
18+
- pod
19+
targetLabel: instance
1420
selector:
1521
matchLabels:
1622
app.kubernetes.io/component: database-compactor

examples/all/manifests/thanos-query-serviceMonitor.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ metadata:
1111
spec:
1212
endpoints:
1313
- port: http
14+
relabelings:
15+
- separator: /
16+
sourceLabels:
17+
- namespace
18+
- pod
19+
targetLabel: instance
1420
selector:
1521
matchLabels:
1622
app.kubernetes.io/component: query-layer

examples/all/manifests/thanos-receive-serviceMonitor.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ metadata:
1111
spec:
1212
endpoints:
1313
- port: http
14+
relabelings:
15+
- separator: /
16+
sourceLabels:
17+
- namespace
18+
- pod
19+
targetLabel: instance
1420
selector:
1521
matchLabels:
1622
app.kubernetes.io/component: database-write-hashring

examples/all/manifests/thanos-rule-serviceMonitor.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ metadata:
1111
spec:
1212
endpoints:
1313
- port: http
14+
relabelings:
15+
- separator: /
16+
sourceLabels:
17+
- namespace
18+
- pod
19+
targetLabel: instance
1420
selector:
1521
matchLabels:
1622
app.kubernetes.io/component: rule-evaluation-engine

examples/all/manifests/thanos-store-serviceMonitor.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ metadata:
1111
spec:
1212
endpoints:
1313
- port: http
14+
relabelings:
15+
- separator: /
16+
sourceLabels:
17+
- namespace
18+
- pod
19+
targetLabel: instance
1420
selector:
1521
matchLabels:
1622
app.kubernetes.io/component: object-store-gateway

jsonnet/kube-thanos/kube-thanos-compact.libsonnet

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,14 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
111111
matchLabels: tc.config.podLabelSelector,
112112
},
113113
endpoints: [
114-
{ port: 'http' },
114+
{
115+
port: 'http',
116+
relabelings: [{
117+
sourceLabels: ['namespace', 'pod'],
118+
separator: '/',
119+
targetLabel: 'instance',
120+
}],
121+
},
115122
],
116123
},
117124
},

jsonnet/kube-thanos/kube-thanos-query.libsonnet

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,14 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
111111
matchLabels: tq.config.podLabelSelector,
112112
},
113113
endpoints: [
114-
{ port: 'http' },
114+
{
115+
port: 'http',
116+
relabelings: [{
117+
sourceLabels: ['namespace', 'pod'],
118+
separator: '/',
119+
targetLabel: 'instance',
120+
}],
121+
},
115122
],
116123
},
117124
},

jsonnet/kube-thanos/kube-thanos-receive.libsonnet

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,14 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
160160
matchLabels: tr.config.podLabelSelector,
161161
},
162162
endpoints: [
163-
{ port: 'http' },
163+
{
164+
port: 'http',
165+
relabelings: [{
166+
sourceLabels: ['namespace', 'pod'],
167+
separator: '/',
168+
targetLabel: 'instance',
169+
}],
170+
},
164171
],
165172
},
166173
},

jsonnet/kube-thanos/kube-thanos-rule.libsonnet

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,14 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
125125
matchLabels: tr.config.podLabelSelector,
126126
},
127127
endpoints: [
128-
{ port: 'http' },
128+
{
129+
port: 'http',
130+
relabelings: [{
131+
sourceLabels: ['namespace', 'pod'],
132+
separator: '/',
133+
targetLabel: 'instance',
134+
}],
135+
},
129136
],
130137
},
131138
},

jsonnet/kube-thanos/kube-thanos-store.libsonnet

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,14 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
275275
matchLabels: ts.config.podLabelSelector,
276276
},
277277
endpoints: [
278-
{ port: 'http' },
278+
{
279+
port: 'http',
280+
relabelings: [{
281+
sourceLabels: ['namespace', 'pod'],
282+
separator: '/',
283+
targetLabel: 'instance',
284+
}],
285+
},
279286
],
280287
},
281288
},

0 commit comments

Comments
 (0)