Get DB Stats Prometheus
GET {{URL}}/v1/stats/db?format=prometheus
Send a
GET
call to the
/v1/stats/db
endpoint with
format
=
prometheus
to retrieve database stats in Prometheus format.
Checking the database stats can take a long time and affect app performance if your database is large. It is recommended polling this information only when needed.
Returned Fields
Name | Description |
---|---|
db_contacts
Type: Object | Current number of contacts in the database. |
db_message_receipts
Type: Object | Current number of message receipts in the database. |
db_messages
Type: Object | Current number of messages in the database. |
db_pending_callbacks
Type: Object | Current number of pending callbacks in the database. |
db_pending_messages
Type: Object | Current number of pending messages in the database. |
Request Params
| Key | Datatype | Required | Description |
| format
| string | | |
HEADERS
| Key | Datatype | Required | Description |
RESPONSES
status: OK
"{\n \"stats\": {\n \"db\": {\n \"your-hostname1:your-container-id1\": {},\n \"your-primary-master:your-container-id2\": {\n \"db_contacts\": {\n \"data\": [ {\n \"labels\": {\n \"type\": \"whatsapp_user\"\n },\n \"value\": 4\n } ],\n \"help\": \"Current number of contacts in DB\",\n \"type\": \"gauge\"\n },\n\n \"db_message_receipts\": { ... },\n\n \"db_messages\": { ... },\n \n \"db_pending_callbacks\": { ... },\n \n \"db_pending_messages\": { ... }\n },\n \"your-hostname3:your-container-id3\": {},\n ...\n } \n },\n \"meta\": {\n \"api_status\": \"stable\",\n \"version\": \"v2.45.1\"\n }\n}"