...
1apiVersion: monitoring.coreos.com/v1
2kind: ServiceMonitor
3metadata:
4 name: grafana
5 namespace: grafana
6 annotations:
7 monitoring.edge.ncr.com/allowed-metrics: |
8 {job="grafana-service"}
9spec:
10 selector:
11 matchLabels:
12 app.kubernetes.io/name: grafana
13 endpoints:
14 - port: grafana-http
15 metricRelabelings:
16 - action: replace
17 regex: ^grafana_([a-z\d_]+)
18 replacement: $${1}
19 sourceLabels:
20 - __name__
21 targetLabel: __name__
22 - action: replace
23 regex: ^([a-z\d_]+)
24 replacement: grafana_$${1}
25 sourceLabels:
26 - __name__
27 targetLabel: __name__
28 - action: drop
29 regex: grafana_alerting.*
30 sourceLabels:
31 - __name__
32 - action: keep
33 regex: grafana_.*
34 sourceLabels:
35 - __name__
View as plain text