Use Aidbox Metrics Server
This guide explains how to set up and use Aidbox Metrics Server
Setup and environment variable
DefineBOX_METRICS_PORT
environment variable with monitoring server port number.
Start metrics server
Aidbox exposes metrics on the endpoint <AIDBOX_BASE_URL>/<BOX_METRICS_PORT>
.
To check if the monitoring server works make the GET <AIDBOX_BASE_URL>:<BOX_METRICS_PORT>
request. The output should be a string "aidbox metrics".
Metrics server endpoints
There are three types of metrics Aidbox collects and exposes. All endpoints are available on a separate port, e.g. GET <AIDBOX_BASE_URL>:<BOX_METRICS_PORT>/metrics
.
Endpoint | Update frequency |
---|---|
| continuous |
| every minute |
| every hour |
The /metrics/hours
response can take some time since it collects much information from the database. Make sure your metrics scraper timeout is sufficient.
Prometheus example scrapers configuration
Collected metrics
HTTP
Metric | Update frequency | Description |
---|---|---|
| continuous | request duration as cumulative counters for buckets |
| continuous | request duration events count |
| continuous | sum of request duration events value |
| continuous | queue waiting time as cumulative counters for buckets |
| continuous | queue waiting time events count |
| continuous | sum of queue waiting time events value |
Postgres
Metric | Update frequency | Description |
---|---|---|
| continuous | number of executed selects requests |
| continuous | number of executed insert statements |
| continuous | number of executed update statements |
| continuous | number of executed delete statements |
| continuous | number of shared block cache hits |
| continuous | number of shared blocks read |
| continuous | fetched tuples number |
| continuous | returned tuples number |
| continuous | number of errors |
| continuous | number of PG workers |
| every minute | number of index scans |
| every minute | number of sequential scans |
| every minute | number of times executed |
| every minute | statement execution time |
| every minute | mean statement execution time |
| every hour | table size |
| every hour | database size |
| every hour | maximum number of connections |
Hikari (Postgres connection pool)
Metric | Update frequency | Description |
---|---|---|
| continuous | number of active connections |
| continuous | number of idle connections |
| continuous | time taken to create an actual physical connection |
| continuous | number of created physical connections |
| continuous | total amount of time to create all physical connections |
| continuous | number of obtained connections |
| continuous | time taken to obtain a connection |
| continuous | total amount of time to obtain all connections |
| continuous | time consumed by a connection |
| every hour | maximum number of connections |
JVM
Metric | Update frequency | Description |
---|---|---|
| continuous | garbage collector execution time |
| continuous | garbage collector count of launch |
| continuous | heap memory usage |
| continuous | non-heap memory usage |
| continuous | number of live threads including both daemon and non-daemon thread |
| continuous | peak live thread count |
| continuous | number of daemon thread |
| every hour | number of processors available to the JVM |
| every hour | maximum amount of memory that JVM will attempt to use |
| every hour | total amount of memory in JVM |
Disable PostgreSQL metrics
If you have a different pg exporter you can disable Aidbox PostgreSQL metrics for avoiding metrics duplication.
In this case, you should set BOX_METRICS_POSTGRES_ON
to false
value
Last updated