Skip to main content

Monitoring with Prometheus

Dawarich can export certain metrics in a format that can be used by Prometheus.

Configuration​

To enable metrics export, you need to set a few environment variables. The value will be different depending on the container. Make sure you set the correct variable values for appropriate containers.

dawarich_app​

VariableDefaultDescription
PROMETHEUS_EXPORTER_ENABLEDfalseEnable the Prometheus metrics exporter
PROMETHEUS_EXPORTER_HOST0.0.0.0Host address to bind the metrics exporter to
PROMETHEUS_EXPORTER_PORT9394Port number to bind the metrics exporter to

dawarich_sidekiq​

VariableDefaultDescription
PROMETHEUS_EXPORTER_ENABLEDfalseEnable the Prometheus metrics exporter
PROMETHEUS_EXPORTER_HOSTdawarich_appName of the dawarich_app container
PROMETHEUS_EXPORTER_PORT9394Port number to bind the metrics exporter to

Update to docker-compose.yml​

The web-entrypoint.sh script automatically starts the Prometheus exporter when PROMETHEUS_EXPORTER_ENABLED is set to true. No changes to the Docker command are needed β€” just set the environment variables and uncomment the port mapping (9394:9394) in your docker-compose.yml.

Metrics​

Some of the metrics that can be exported are:

The application metrics are:

TypeNameDescription
Counterhttp_requests_totalTotal HTTP requests from web app
Summaryhttp_request_duration_secondsTime spent in HTTP reqs in seconds
Summaryhttp_request_redis_duration_secondsTime spent in HTTP reqs in Redis, in seconds
Summaryhttp_request_sql_duration_secondsTime spent in HTTP reqs in SQL in seconds
Summaryhttp_request_queue_duration_secondsTime spent queueing the request in load balancer in seconds
Summaryhttp_request_memcache_duration_secondsTime spent in HTTP reqs in Memcache in seconds

The sidekiq metrics are:

TypeNameDescription
Gaugeactive_record_connection_pool_connectionsTotal connections in pool
Gaugeactive_record_connection_pool_busyConnections in use in pool
Gaugeactive_record_connection_pool_deadDead connections in pool
Gaugeactive_record_connection_pool_idleIdle connections in pool
Gaugeactive_record_connection_pool_waitingConnection requests waiting
Gaugeactive_record_connection_pool_sizeMaximum allowed connection pool size

The complete list of metrics can be found in the prometheus_exporter library readme, which is being used by Dawarich.