Chapter 8 gives this two lines with a reference to the accounting chapter, and their importance is out of proportion to their length.
The direction changes. Analytics built on files requires collecting them from the node: waiting for a file to close, reading someone else’s file system, polling. Sending removes all of this at once — a node that sends records itself does not need to be polled for them at all.
The price is a receiver that must be available or must tolerate whatever retry behavior the node ends up having. Chapter 8 does not describe it; the description is in § 12.1.1, and the contract there is simple: retry until a 2xx response, accumulate on the node’s disk.
And it is an addition, not a replacement. Both methods work at the same time, so the transition can be made without a jolt: enable the webhook next to the files, reconcile, turn off what is not needed.
Polling remains for summaries. Once a day the “Accounting stats” module runs the pmtastats utility on the node over SSH — it counts over the CSV accounting files, and the webhook file is of no use to it.
This also implies a limitation: if the Hub has no public address, there is nowhere to send, and the telemetry block is not written at all. Then polling through the management interface remains — poorer in data, but it works.
The mechanism has no values of its own: it is enabled by one line, http-webhook-url, and everything else configures the details of sending.
| What it decides | With what |
|---|---|
| where to send | http-webhook-url |
| how often | http-webhook-max-interval |
| how to prove it is your node | http-webhook-extra-headers or http-webhook-certificate |
# one line changes the direction of the accounting stream <acct-file /var/log/pmta/webhook.json> records d, b, t http-webhook-url https://hub.example.com/api/telemetry/pmta/7 http-webhook-extra-headers /etc/pmta/mtahub-headers.txt </acct-file>
what people get wrong and how it ends2 mistakes▶
§ 12.1.1
our experience
4 relations
min-free-space<signals>The same trouble as with the accounting webhook: an unavailable receiver causes accumulation, but the limit here is on disk. inferenceCSV or JSON — chosen by the file extension, not by a directiveThe path extension decides not only the record format but also the content type header in the request sent. § 12.1.1
tail -f /var/log/nginx/access.log | grep telemetry
3 articles
◇What the node tells about itself and through which channelsSeven observation surfaces: the web monitor, the console in four formats, the log, accounting, accounting search, metrics and export to external analytics.◇Two inbound report processors and what to do with themBounces by message and complaints are parsed by two identically structured blocks; each has its own address list and its own pair of decisions about the message’s fate.◇Five ways for a queue to hand off a messageA queue does not have to use SMTP: it can write to a file, run a program, call over HTTP or discard.