Monitor

The Database Connector exposes an HTTP server that can be used to monitor instance health and metrics.

The server listens on the port defined by the ADBC_HEALTH_ADDRESS configuration option and defaults to port 2259.

The Database Connector exposes an HTTP endpoint on /health that returns a JSON containing the status of:

  • Connectivity to the Ably service.
  • Connectivity to the PostgreSQL database.
  • Access to the nodes table, determined by executing SELECT 1 FROM nodes.
  • Access to the outbox table, determined by executing SELECT 1 FROM outbox.

Internally, the connector periodically refreshes the health status for each target according to the interval defined by the ADBC_HEALTH_REFRESH_INTERVAL configuration option.

The following is an example of a healthy response from the endpoint:

curl localhost:2259/health { "ably":{ "status":"up" }, "nodes_table":{ "status":"up" }, "outbox_table":{ "status":"up" }, "postgres":{ "status":"up" } }
Copied!

The Database Connector exposes an HTTP endpoint on /metrics that implements a Prometheus metrics endpoint that can be used to monitor the following metrics:

Metric Type Description
ably_pending_acks gauge Number of pending messages waiting to be acknowledged by Ably.
nodes_table_entries gauge Number of entries in the nodes table.
nodes_table_errors counter Number of errors querying the nodes table.
outbox_table_entries gauge Number of entries in the outbox table.
outbox_table_errors counter Number of errors querying the outbox table.
promhttp_metric_handler_errors_total counter Total number of internal errors encountered by the promhttp metric handler.

The following is an example response from the metrics endpoint:

curl localhost:2259/metrics # HELP ably_pending_acks Number of pending messages waiting to be acknowledged by Ably # TYPE ably_pending_acks gauge ably_pending_acks 0 # HELP nodes_table_entries Number of entries in the nodes table # TYPE nodes_table_entries gauge nodes_table_entries 1 # HELP nodes_table_errors Number of errors querying the nodes table # TYPE nodes_table_errors counter nodes_table_errors 0 # HELP outbox_table_entries Number of entries in the outbox table # TYPE outbox_table_entries gauge outbox_table_entries 1 # HELP outbox_table_errors Number of errors querying the outbox table # TYPE outbox_table_errors counter outbox_table_errors 0 # HELP promhttp_metric_handler_errors_total Total number of internal errors encountered by the promhttp metric handler. # TYPE promhttp_metric_handler_errors_total counter promhttp_metric_handler_errors_total{cause="encoding"} 0 promhttp_metric_handler_errors_total{cause="gathering"} 0
Copied!
Health