Monitoring
MXHook exposes Prometheus-compatible metrics for monitoring your deployment.
Prometheus Metrics
Key metrics to monitor:
| Metric | Type | Description |
|---|---|---|
mxhook_messages_received_total | Counter | Total emails received by SMTP server |
mxhook_messages_delivered_total | Counter | Total successful webhook deliveries |
mxhook_messages_failed_total | Counter | Total failed webhook deliveries |
mxhook_dlq_size | Gauge | Current number of entries in the dead letter queue |
mxhook_webhook_duration_seconds | Histogram | Webhook delivery latency |
mxhook_smtp_connections_active | Gauge | Current active SMTP connections |
Grafana Dashboard
MXHook includes a Grafana dashboard in the deploy/ directory. Import it into your Grafana instance for a pre-built overview of:
- Message throughput (received, delivered, failed)
- Webhook delivery latency (p50, p95, p99)
- DLQ depth over time
- SMTP connection activity
- Error rates
Health Check
The /health endpoint returns the service status:
bash
curl http://localhost:8080/healthjson
{"status": "ok"}Use this for load balancer health checks and container orchestration liveness probes.
Alerting Recommendations
| Condition | Threshold | Severity |
|---|---|---|
| DLQ size growing | > 10 entries | Warning |
| Webhook error rate | > 5% over 5 minutes | Critical |
| Delivery latency p95 | > 800ms | Warning |
| SMTP connection errors | > 0 sustained | Warning |