Observability
Service Monitoring
Service Monitoring
Documentation on how services are monitored.
What is Service Monitoring?
Service monitoring involves collecting metrics (numerical data) from your applications to understand their performance and health. In Kubernetes, this is often done using the Prometheus Operator, which defines a ServiceMonitor resource. A ServiceMonitor tells Prometheus custom resources which internal Kubernetes Services to scrape for metrics.
Official Prometheus Operator Documentation
ServiceMonitor
The ServiceMonitor Custom Resource Definition (CRD) allows Prometheus to scrape metrics from Kubernetes Services.
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: services-monitor
spec:
selector:
matchLabels:
app: services
endpoints:
- port: http
path: /metrics
interval: 15s