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
KeysValueDescription
spec.monitor.agentstringRequired. Indicates the monitoring agent used. Only valid value currently is coreos-prometheus-operator
spec.monitor.prometheus.namespacestringRequired. Indicates namespace where service monitors are created. This must be the same namespace of the Prometheus instance.
spec.monitor.prometheus.labelsmapRequired. Indicates labels applied to service monitor.
spec.monitor.prometheus.intervalstringOptional. 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