Kubernetes Monitoring
is done with prometheus. Webinterface is grafana.
https://prometheus.acc.gsi.de/grafana/
Service Metrics
Prometheus is doing auto discovery of pods and services it should monitor. For all pods a basic monitoring (cpu, memory) is active. If the pod or service is instrumented and exposes additional information (java heap, etc) on a http url prometheus can collect this data. The pod or service must have the following annotations
metadata:
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '80'
prometheus.io/path: '/metrics'
prometheus.io/scheme: 'http'
- prometheus.io/path: '/metrics'annotation
prometheus.io/scrape
declares that this service should be monitored. the value is a string. All annotations are always strings.
- path
/metrics
is the default, overwrite where necessary for example with /actuator/prometheus
- scheme can switch between http and https.
- port is the port where prometheus can query for metrics. For services this defaults to the service ports. If a service exposes multiple ports, for example one http port and one rmi port, overwrite it to only scrape the http port.
--
ChristophHandel - 21 Jun 2022