Simple ServiceMonitor¶
This example show a basic configuration for ServiceMonitor.
spec:
endpoints:
- interval: 30s
port: http
jobLabel: k8s-app
selector:
matchLabels:
k8s-app: sample-service
It means that Prometheus/Victoriametrics will collect metrics from service with settings:
- metrics will collect with job with label
k8s-app
- metrics will collect from all pods with label
k8s-app: sample-service
- metrics will collect from all discovered pod from port with name
http
with interval30s
Files¶
How to apply example¶
Kubernetes:
OpenShift:
Links¶
Prometheus operator API
Victoriametrics operator API