You are looking at the documentation of a prior release. To read the documentation of the latest release, please
visit here.
New to KubeDB? Please start here.
Monitoring KubeDB
KubeDB has native support for monitoring via Prometheus.
Monitoring KubeDB Operator
KubeDB operator exposes Prometheus native monitoring data via /metrics
endpoint on :56790
port. You can setup a CoreOS Prometheus ServiceMonitor using kubedb-operator
service. To change the port, use --address
flag on KubeDB operator.
Monitoring Databases
KubeDB operator can create service monitors for database pods.
If enabled, a side-car exporter pod is run with database pods to expose Prometheus ready metrics via the following endpoints on port :56790
:
/kubedb.com/v1beta1/namespaces/:ns/(postgreses|elastics)/:name/metrics
: Scrape this endpoint to monitor database.
First deploy Prometheus operator so that Prometheus CRD groups are registered. Then, to monitor KubeDB databases by Prometheus, set following fields in spec.monitor.prometheus
:
spec:
monitor:
agent: coreos-prometheus-operator
prometheus:
namespace: default
labels:
app: kubedb-exporter
interval: 10s
Keys | Value | Description |
---|---|---|
spec.monitor.agent | string | Required . Indicates the monitoring agent used. Only valid value currently is coreos-prometheus-operator |
spec.monitor.prometheus.namespace | string | Required . Indicates namespace where service monitors are created. This must be the same namespace of the Prometheus instance. |
spec.monitor.prometheus.labels | map | Required . Indicates labels applied to service monitor. |
spec.monitor.prometheus.interval | string | Optional . Indicates the scrape interval for database exporter endpoint (eg, ’10s') |
Known Limitations: If the databse password is updated, exporter must be restarted to use the new credentials. This issue is tracked here.
Next Steps
- Thinking about monitoring your database? KubeDB works out-of-the-box with Prometheus.
- Learn how to use KubeDB to run a PostgreSQL database here.
- Learn how to use KubeDB to run an Elasticsearch database here.
- Wondering what features are coming next? Please visit here.
- Want to hack on KubeDB? Check our contribution guidelines.