update prom

This commit is contained in:
2025-03-30 19:53:01 +02:00
parent caff5bf5e4
commit 1c41afde20
2 changed files with 0 additions and 59 deletions

View File

@@ -128,44 +128,3 @@ local kp = (import 'kube-prometheus/main.libsonnet') + {
{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +
{ ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } +
{ [name + '-ingress']: kp.ingress[name] for name in std.objectFields(kp.ingress) }
/*
Add a ServiceMonitor for Prometheus self-scrape.
The relabeling below forces the job label to be "prometheus", so that querying with:
up{job="prometheus"}
will return Prometheus's own metrics.
NOTE: Adjust the matchLabels selector if your Prometheus service has different labels.
*/
{ 'prometheus-self-monitor': {
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata: {
name: 'prometheus-self-monitor',
namespace: kp.values.common.namespace,
labels: {
release: 'prometheus',
},
},
spec: {
selector: {
matchLabels: {
// This selector should match labels on the Prometheus service.
// Here we assume the Prometheus service is labeled with:
// prometheus: "prometheus-k8s"
prometheus: 'prometheus-k8s',
},
},
endpoints: [{
port: 'web', // Must match the name of the port exposed by the Prometheus service
path: '/metrics',
scheme: 'http', // Change to "https" if your Prometheus endpoint requires it
relabelings: [{
targetLabel: 'job',
replacement: 'prometheus',
}],
}],
},
},
}

View File

@@ -1,18 +0,0 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
release: prometheus
name: prometheus-self-monitor
namespace: monitoring
spec:
endpoints:
- path: /metrics
port: web
relabelings:
- replacement: prometheus
targetLabel: job
scheme: http
selector:
matchLabels:
prometheus: prometheus-k8s