New to KubeDB? Please start here.
Monitoring HanaDB
KubeDB exposes Prometheus metrics for HanaDB through a bundled
hanadb_exporter sidecar. You enable it through the
spec.monitor field of the HanaDB object.
How it works
When spec.monitor is set, KubeDB adds an exporter container to the database pods and a <db>-stats
Service that exposes the metrics endpoint (default port 9668, path /metrics). Two agents are
supported:
prometheus.io/builtin— annotates the stats Service so a Prometheus server that scrapes by annotation discovers the target. See Using Builtin Prometheus.prometheus.io/operator— creates aServiceMonitorfor the Prometheus Operator. See Using Prometheus Operator.
The spec.monitor field
spec:
monitor:
agent: prometheus.io/operator # or prometheus.io/builtin
prometheus:
exporter:
port: 9668
serviceMonitor:
labels:
release: prometheus
interval: 10s
spec.monitor.agentselects the monitoring agent.spec.monitor.prometheus.exporter.portis the exporter port (9668).spec.monitor.prometheus.serviceMonitor.labelsmust match theserviceMonitorSelectorof your Prometheus Operator instance (commonlyrelease: prometheus).































