Some of the Prometheus metrics seem to be unused
Hi there, me again :).
I decided to set up Prometheus monitoring because I was hoping to get alerted when/if I stop receiving e-mails frequently (as that has usually shown to be a problem in the past).
I was quite confused by two points:
- the
maddy_*prometheus metrics don't seem to appear in the/metricsoutput until they actually get incremented (maybe this is intentional? But as a Prometheus noob I would have liked to know on the documentation page before wondering if I missed something) - some of the metrics seem to be unused — for example
completedSMTPTransactionswhich doesn't seem to have a corresponding increment line
❯ rg completedSMTPTransactions
internal/endpoint/smtp/metrics.go
33: completedSMTPTransactions = prometheus.NewCounterVec(
83: prometheus.MustRegister(completedSMTPTransactions)
I can have a crack at these problems if you don't think I'm wrong.
I would also like to add some more metrics — for example on the number of e-mails that get successfully sent over LMTP (perhaps excluding ones received from local users ... hmm), so that I can have a very clear number of 'received e-mails' that actually make it to Dovecot rather than the queues getting deadlocked (which seems to have bitten me every few months on older versions). Does that sound reasonable?
the maddy_* prometheus metrics don't seem to appear in the /metrics output until they actually get incremented (maybe this is intentional? But as a Prometheus noob I would have liked to know on the documentation page before wondering if I missed something)
Metrics are parametrized by module name so before sending actually happens we don't know what to put in the module name.
I can have a crack at these problems if you don't think I'm wrong.
Oh, I must have missed completedTransactions.
excluding ones received from local users
I guess a bunch of metrics covering outbound delivery would be definitely useful. (ref #264)
rather than the queues getting deadlocked
maddy_queue_length probably can be used for this but I am open to adding more metrics that you think would be useful.