diff --git a/README.md b/README.md index 75a1825..4bd354f 100644 --- a/README.md +++ b/README.md @@ -527,7 +527,7 @@ The exposed metrics include a lot of different data but the most important ones ##### zonemta_delivery_status -`zonemta_delivery_status` exposes counters for delivery statuses. There are 3 different `result` label values +`zonemta_delivery_status` exposes counters for delivery statuses. There are 3 different `result` label values. The zone name is exposed in the `zone` label. - `result="delivered"` – count of deliveries accepted by remote MX - `result="rejected"` – count of deliveries that hard bounced diff --git a/lib/queue-server.js b/lib/queue-server.js index 016d924..f441297 100644 --- a/lib/queue-server.js +++ b/lib/queue-server.js @@ -13,7 +13,7 @@ const promClient = require('prom-client'); const deliveryStatusCounter = new promClient.Counter({ name: 'zonemta_delivery_status', help: 'Delivery status', - labelNames: ['status'] + labelNames: ['status', 'zone'] }); const messagePushCounter = new promClient.Counter({ name: 'zonemta_message_push', @@ -155,7 +155,8 @@ class QueueServer { deliveryStatus = data.status.delivered ? 'delivered' : 'rejected'; } deliveryStatusCounter.inc({ - status: deliveryStatus + status: deliveryStatus, + zone: client.zone.name }); return this.releaseDelivery(client.zone, client.id, data, (err, response) => { if (!client) { @@ -188,7 +189,8 @@ class QueueServer { }); } deliveryStatusCounter.inc({ - status: 'deferred' + status: 'deferred', + zone: client.zone.name }); return this.deferDelivery(client.zone, client.id, data, (err, response) => {