Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4694-error-email-throttling.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Error emails can be throttled per error fingerprint and globally with `errorEmailRateLimit`, `errorEmailRateWindowMinutes`, and `errorEmailGlobalRateLimit`; all defaults remain unlimited (#4694)
18 changes: 18 additions & 0 deletions cli/lucli/templates/app/.ai/views.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,21 @@ In the `development` environment, an error response asked for as
`Accept: application/json` (or `?format=json`) is that same payload as JSON,
and `Accept: text/markdown` (or `?format=md`) gets it as Markdown, with the
error page's status code. Testing and production responses are unchanged.

### Error-email throttling

Production turns `sendEmailOnError` on; configure `errorEmailAddress` (or `errorEmailToAddress`) or no email is sent. To keep a bot scan or a repeating error
from flooding the inbox, set:

- `errorEmailRateLimit` — most emails for one error fingerprint per window
(default `0`, unlimited);
- `errorEmailGlobalRateLimit` — most error emails across all fingerprints per
window (default `0`, unlimited);
- `errorEmailRateWindowMinutes` — the fixed window in minutes (default `15`).

A fingerprint is the root cause type + message + first application stack frame.
When a window expires, the next allowed email includes a short count of the
occurrences suppressed since the last one. These counters live in the
application scope per server; on a multi-server deployment the caps are per
node, not global across the fleet.

4 changes: 4 additions & 0 deletions cli/lucli/templates/app/config/production/settings.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
// Error emails (sendEmailOnError is on in production) go only to an address
// you configure; with none set, no error email is sent. Example:
// set(errorEmailAddress = "ops@example.com");
// Optional error-email throttling (caps default to 0 = unlimited):
// set(errorEmailRateLimit = 3); // per error fingerprint, per window
// set(errorEmailGlobalRateLimit = 30); // all error emails, per window
// set(errorEmailRateWindowMinutes = 15); // fixed window, 1..1440
</cfscript>
4 changes: 4 additions & 0 deletions cli/lucli/templates/app/config/settings.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
// Error emails: production turns sendEmailOnError on, but they go only to
// an address you configure. With none set, no error email is sent.
// set(errorEmailAddress=env("WHEELS_ERROR_EMAIL", ""));
// Optional error-email throttling (both caps default to 0 = unlimited):
// set(errorEmailRateLimit=3); // per error fingerprint, per window
// set(errorEmailGlobalRateLimit=30); // all error emails, per window
// set(errorEmailRateWindowMinutes=15); // fixed window, 1..1440

/*
Canonical base URL for absolute links, redirects and emails. When set, its
Expand Down
3 changes: 3 additions & 0 deletions cli/src/commands/wheels/get/settings.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ component extends="../base" {
"errorEmailAddress": "",
"errorEmailServer": "",
"errorEmailSubject": "Error",
"errorEmailRateLimit": 0,
"errorEmailRateWindowMinutes": 15,
"errorEmailGlobalRateLimit": 0,
"excludeFromErrorEmail": "",
"includeErrorInEmailSubject": true,
"overwritePlugins": true,
Expand Down
18 changes: 18 additions & 0 deletions docs/consumer-ai/.ai/views.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,21 @@ In the `development` environment, an error response asked for as
`Accept: application/json` (or `?format=json`) is that same payload as JSON,
and `Accept: text/markdown` (or `?format=md`) gets it as Markdown, with the
error page's status code. Testing and production responses are unchanged.

### Error-email throttling

Production turns `sendEmailOnError` on; configure `errorEmailAddress` (or `errorEmailToAddress`) or no email is sent. To keep a bot scan or a repeating error
from flooding the inbox, set:

- `errorEmailRateLimit` — most emails for one error fingerprint per window
(default `0`, unlimited);
- `errorEmailGlobalRateLimit` — most error emails across all fingerprints per
window (default `0`, unlimited);
- `errorEmailRateWindowMinutes` — the fixed window in minutes (default `15`).

A fingerprint is the root cause type + message + first application stack frame.
When a window expires, the next allowed email includes a short count of the
occurrences suppressed since the last one. These counters live in the
application scope per server; on a multi-server deployment the caps are per
node, not global across the fleet.

Loading
Loading