Email reports
On this page
Email reports: daily, weekly and monthly
With BoxLang+, BxLens can email an admin a short report of how the whole cluster did. It is set up next to the alerts, in Settings, Notifications (see Notifications for the SMTP settings and the recipients).
Who gets what
In the list of recipients, tick daily, weekly and monthly for each person. Under Reports choose:
| Setting | Meaning |
|---|---|
| Sent at, zone | The time of day and the time zone (the zone of the server when empty). |
| Weekly on | The weekday of the weekly report (Monday by default). |
| Monthly from day | The day of the month, 1 to 28 (the 1st by default). A server that was down on that day sends it as soon as it is up. |
The report is for the date in the zone you chose. The numbers are the UTC days that the servers save, so a zone ahead of UTC (for example +13) waits until the UTC date has caught up before the report goes out, and the last day of the period is never half empty. Switching the notifications on does not send the daily, weekly and monthly report at once: the report of the period you are in counts as sent, and the next one is the first. If one person's mail fails, only that person is tried again, not everyone.
One server sends for the whole cluster, the same one that sends alerts. A report is sent once: the last one sent is remembered in the store, so a restart or another server taking over never sends it twice.
What is in a report
A report covers a run of UTC days that ends yesterday, set against the run just before it:
| Report | Covers | Compared with |
|---|---|---|
| Daily | Yesterday | The day before |
| Weekly | The seven days before today | The seven days before those |
| Monthly | The whole calendar month before this one | The month before it |
It holds, for all servers added together and then per server:
- Highlights in plain words: requests up or down on the period before, the failed share, alerts that fired, a deadlock, restarts, a heap peak over 90%.
- Traffic: requests, failed share, average time, slow requests, exceptions.
- Mail (when the Mail integration is on): sent and failed.
- Capacity: the heap and CPU peaks, and the fullest volume of each server.
- Alerts that fired, by name.
- Errors: the events of the period against the period before, how many issues are new, regressed and resolved, how many are still open, and the five busiest issues with their change and status, merged across servers. It reads the daily counts that each issue keeps, so a week report counts the whole week.
- Outgoing HTTP: the five hosts with the most failed calls, from the saved HTTP rollups.
- MCP rate limits: for the MCP servers hosted with bx-ai that have a rate limit, the calls and the blocked calls of each, and the five clients with the most blocked calls (an IP or a short hash). It is left out when no rate limit was seen. Servers that share the cache of the rate limit report the same day, so their numbers are not added twice.
It says how many of the server days it wanted it could find, for example "Data found for 12 of 14 server days".
What the mail looks like
Alerts and reports share one design. The mail is a 600 pixel card with a dark header band (the BxLens logo and a small word: ALERT, DAILY REPORT, WEEKLY REPORT, MONTHLY REPORT) and a coloured line under it: red for a firing alert, amber for a reminder or a warning, green for a resolved one, cyan for a report and the test mail.
- An alert has a pill (FIRING, STILL FIRING, RESOLVED), the title, one plain sentence, a table of facts (server, what it is about, severity, since or how long it lasted), a line on what to look at first and one button, Open in BxLens. A bad minute is still one mail per person: when several alerts come together the mail has one block for each, under a summary line, and one button.
- A report has six tiles (requests, failed share, average time, slow requests, exceptions, alerts fired) with the change against the period before (green is better, red is worse, "no earlier data" when the period before has no saved data), the highlights, a Trend for the weekly and monthly report, the servers, the top errors, the slowest outgoing hosts, the MCP rate limits, the coverage line and the button Open the full report in BxLens.
- The trend is drawn with the cells of a table: a bar is a cell with a height, one bar for each day of the period (requests, and failed requests). It is not an SVG, because many mail clients remove SVG and would show nothing. The failed bars are green when the second half of the period had fewer failures than the first, and red when it had more.
- The test mail says "It works", the SMTP server it used, who sent it and when.
Every mail has a plain text part (it comes first, the HTML part second, in a multipart/alternative) with the same facts, readable in a terminal or a client that shows no HTML. The HTML is made for mail clients that cannot be trusted: tables for the layout, inline styles, no script, no flexbox or grid, no web font and no picture that is loaded from a server. The logo is part of the mail (an inline attachment, cid:bxlens-logo, so it shows without "load images"); if the file is missing the mail shows the name BxLens as text.
Dark mode. A mail client that supports prefers-color-scheme (Apple Mail, Outlook for Mac, many mobile apps) shows a dark palette; the others show the light design, which is also the design of every client that ignores the style block.
The link. The button uses console.publicUrl in boxlang.json (the address people reach the console at, for example https://lens.acme.com/~bxlens/index.bxm). It is the same setting the channels use. When it is empty the notification settings' own console address is used, and when that is empty too the mail has no button and no link.
The subjects. Alerts: [BxLens] CRITICAL: <title> on <server>, [BxLens] Warning: ..., [BxLens] Resolved: ... and, for several in one mail, [BxLens] 2 alerts, 1 resolved. Reports: [BxLens] Daily report for 2026-10-20, [BxLens] Weekly report, 2026-10-12 to 2026-10-18, [BxLens] Monthly report for September 2026. The test mail: [BxLens] Test mail from <server>.
Preview and send now
Preview daily, weekly, monthly builds the report and shows it in a locked frame, without sending anything. Send daily now (and weekly, monthly) mails it to everyone who gets it, or to one address you type, to check how it looks in your mail client.
What it needs
- The disk store must be on (
store.enabled). Each server saves one small document per day (the counters of its requests, its peaks, its alerts), and keeps it forstore.retentionDaysdays. The default is 15 days, so a monthly report needsstore.retentionDaysof 30 to cover the whole month. With less, the report says it found part of the month. - Days start counting from the first minute a server with this version ran. There is no history before that.
- The AI integration is not part of the report yet.
Safety
The same rules as alerts: admin only, BoxLang+, every change audited, nothing from the data goes into the HTML without escaping, and the preview runs in a sandboxed frame without scripts or network.