Knowledge base

Exposing metrics to a collector

metrics exporter implementation
Its own format for external monitoring

Serving node metrics to a Prometheus collector: the engine brings up its own <prometheus-listener> listener — one per node, on the address and port from its name — and the format is provided by the built-in prometheus-cpp library, which the manual lists among third-party components.

The two latency metrics are summaries with precomputed quantiles: 0.50, 0.90, 0.95 and 0.99 are computed inside each node from its own observations. So a fleet quantile cannot be assembled from them: the average p95 of eight nodes is not the fleet’s p95.

The main trap is averaging node quantiles. A summary serves already computed quantiles, while the data a fleet quantile could be derived from stays inside the nodes. The spread of p95 across nodes answers “are the nodes alike”, not “what does the slowest twentieth of traffic see”.
What the Hub does. It does not use it: the Hub takes telemetry with requests to the monitor and builds fleet charts as a corridor of node values. If these metrics ever feed the corridor, the label will have to change: the spread of node p95 values is not the fleet’s p95.
Recommended values

What is set:

What How
address and port the <prometheus-listener> block name, for example 127.0.0.1:9090
a range instead of an address the engine takes one matching address and writes it to the log
domains for the first-attempt metric time-first-attempt-domains-file, up to 100 domains
One listener, the address form, choosing an address from a range and the domain file come from the manual (§ 3.3.25, § 14). The trap analysis is ours.
Example configuration
# metrics on the internal address only
<prometheus-listener 10.0.0.5:9090>
    time-first-attempt-domains-file /etc/pmta/ttfa-domains</prometheus-listener>
The domain file is needed only by the first-attempt time metric and works together with track-time-first-attempt.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
How to check on the node
Check that metrics are served:
curl -s http://10.0.0.5:9090/metrics | head -20
Lines like pmta_… are engine metrics, and the /metrics path is the usual one for a Prometheus collector; an empty response means the listener is not up or listens on a different address.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Capacity planning · Troubleshoot deliverability · Collect telemetry