Skip to content

Commit 9cd8c21

Browse files
authored
fix(monitoring): stop parca-analytics from scraping its own Thanos components (#473)
Its podMonitorSelector/serviceMonitorSelector were left at the {} default (match all labels), so despite the namespace selector already restricting discovery to its own namespace, it was still picking up the thanos-sidecar/thanos-query/thanos-store ServiceMonitors living there. This instance only ingests via remote-write and shouldn't scrape anything at all (self-monitoring is the parca instance's job). Sets both selectors to an `In: []` match-expression, which never matches regardless of labels.
1 parent 43ceb18 commit 9cd8c21

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

monitoring/environments/scaleway-parca-demo/main.jsonnet

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,16 @@ local prometheuses = [
333333
projectID: '5a755043-1fb8-48fd-a2c8-2787498ec59d',
334334
},
335335
}],
336-
// This instance only ingests via remote-write and monitors its own Thanos
337-
// components. The default {} selectors match every PodMonitor/ServiceMonitor
338-
// cluster-wide, which would pull in unrelated apps (parca-agent, pyrra, ...).
336+
// This instance only ingests via remote-write; it does not scrape anything,
337+
// including its own Thanos sidecar/query/store (that's the parca instance's
338+
// job, see monitoring's serviceMonitorParcaAnalytics). The default {}
339+
// selectors match every PodMonitor/ServiceMonitor cluster-wide, so without
340+
// this it would also pick up unrelated apps (parca-agent, pyrra, ...) plus
341+
// its own Thanos components. `In: []` never matches, regardless of labels.
339342
podMonitorNamespaceSelector: { matchLabels: { 'kubernetes.io/metadata.name': p._config.namespace } },
340343
serviceMonitorNamespaceSelector: { matchLabels: { 'kubernetes.io/metadata.name': p._config.namespace } },
344+
podMonitorSelector: { matchExpressions: [{ key: 'prometheus', operator: 'In', values: [] }] },
345+
serviceMonitorSelector: { matchExpressions: [{ key: 'prometheus', operator: 'In', values: [] }] },
341346
resources+: {
342347
requests+: { cpu: '500m' },
343348
},

0 commit comments

Comments
 (0)