Monitoring

Prometheus metrics, health checks and range status.

Every node serves metrics and the health check on its administration port (27200 by default).

Requirements

  • Network access to the administration port of each node.
  • For /metrics, the client certificate of a user with the clusterMonitor role.

/healthz

Returns 200 if the node is serving and 503 if not, with no body and no credentials. Use it in your load balancer or orchestrator.

/metrics

It answers in the Prometheus exposition format, so any Prometheus server can read it directly. It asks for a client certificate of a user with the clusterMonitor role; without one, the node refuses the request.

MetricWhat it measures
teseladb_upThe node is running
teseladb_rangesRanges with a replica on this node
teseladb_range_applied_index{range}Last applied entry of each replica
teseladb_range_leader{range}Whether this node leads that range
Shell
teseladb admin metrics

With that command you read the same metrics from the CLI, without going through Prometheus, with the credentials in the node's --dbpath.

Ranges

Shell
teseladb admin ranges --collection shop.orders

Shows each range with its bounds, the replicas it has and the node that leads it. From mongosh, serverStatus, currentOp, $collStats and the profiler have MongoDB's shape.

Check

Shell
curl -s -o /dev/null -w "%{http_code}\n" --cacert ca.pem https://node-01:27200/healthz

The command prints 200 if the node is serving. If it prints 503, the node is running but not taking requests yet.

Common problems

  • If /metrics refuses the request, the client certificate is missing or its user lacks the clusterMonitor role.
  • If /healthz answers 503, the node is running but not serving yet. Your load balancer must not send it traffic until it answers 200.

See also