chatmail / chatmail/filtermail
Add metrics
- Dominant language
- Rust
- Stars
- 11
- Forks
- 4
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 17
Description
We have [OpenMetrics](https://openmetrics.io/) support in https://github.com/chatmail/notifiers/:
https://github.com/chatmail/notifiers/blob/736febeed42f319e2cc9fff95125a898c1ea1dab/src/metrics.rs
It works by having an HTTP (no TLS) server that responds to GET request to /metrics endpoint and gives a text with counters.
[Prometheus](https://prometheus.io/) is used to poll the /metrics endpoint and store collected data.
Filtermail may count the number of incoming and outgoing mails that passed the checks or were rejected.
This is currently implemented by using mtail in https://github.com/chatmail/relay/ and counting the log lines:
https://github.com/chatmail/relay/blob/d3a483c40309b480f1e185bfdc97642612984a27/cmdeploy/src/cmdeploy/mtail/delivered_mail.mtail#L47-L80
But this is error-prone and requires that logging is enabled and format of the logs does not change (https://github.com/chatmail/relay/pull/820, https://github.com/chatmail/filtermail/pull/21).
We can also count number of messages with SEIPDv2 and SEIPDv1 packets (https://github.com/chatmail/core/pull/8013) to have idea of how fast users upgrade without logging for each message which one was used.
Metrics can be used not only for counters, but e.g. to monitor the number of open connections in a connection pool, quantiles for delays per destination domain, histogram of the number of recipients per message. This cannot be done by parsing the logs.
This is just a feature request/wishlist, not discussed with anyone, and low priority.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the referenced src/metrics.rs implementation in chatmail/notifiers and the delivered_mail.mtail section in chatmail/relay. Compare those approaches with filtermail's current mail-checking and connection-pool code, then define a focused metric scope and an observable completion criterion; this issue is currently a broad wishlist with no filtermail files or tests named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- prometheus, rust
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100