update prom
This commit is contained in:
@@ -128,44 +128,3 @@ local kp = (import 'kube-prometheus/main.libsonnet') + {
|
|||||||
{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +
|
{ ['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) } +
|
{ ['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) }
|
{ [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',
|
|
||||||
}],
|
|
||||||
}],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user