Monitors and performance issues
Thresholds you set on any span metric, the built-in alerts, the slow patterns Fictura finds in your traces on its own, and cron monitors.
Monitors
A monitor watches one number: the p50, p75, p95 or p99 duration, the average, the error rate, the throughput or the count, of one kind of span, optionally one route, service and environment. Every 5 minutes it reads the last N minutes. Over the threshold, it opens a performance issue on the Issues page and notifies your alert channels; back under, the issue resolves.
Create them under Performance → Monitors, or with Monitor this on any route's page.
| Setting | What it does |
|---|---|
| Metric | p50, p75, p95, p99 or average duration, error rate (%), throughput (per minute) or count. |
| Of | The kind of span: routes, HTTP calls, database calls, model calls, MCP tools, tasks, crons, screens, page loads or app starts. |
| Route | One route, screen, host or table. Empty means all of them together. |
| Compare | The value against the threshold, or its change in percent against the window before. |
| Window | How many minutes are read each time, 5 to 1,440. |
| Judge only with at least | A window with fewer spans isn't judged, so a quiet hour can't fire or clear it. Throughput and count are judged anyway: "fewer than 5 a minute" is the point. |
A firing monitor has one issue. Each time it fires again, that issue gets a new event, so its history shows every time the threshold was crossed.
Built-in alerts
Two alerts run on every app without setup, on the last full hour, per environment. Development, local and test environments never alert.
| Alert | When |
|---|---|
| p95 regression | A route's, screen's or page's p95 is over twice the median of its hourly p95s in the 7 days before, with at least 20 requests in the hour. |
| Slow dependency | An HTTP host's or database table's p95 is over 3 s, with at least 20 calls in the hour. |
Both go to the same channels as error alerts: email through Resend, Slack or a webhook.
Performance issues
Fictura reads your traces for slow patterns and files each one as a warning issue, one issue per pattern and route. The thresholds are Sentry's where Sentry publishes them.
| Issue | When it's filed |
|---|---|
| N+1 Query | 5 or more of the same database call (table and operation) one after another under one request, over 50 ms together. |
| Consecutive DB Queries | Different database calls one after another, each over 30 ms, that would save over 100 ms and over 10% of the request if run side by side. |
| Slow DB Query | A database call of 1 s or more, once the same call has been that slow 100 times in 24 hours. |
| Consecutive HTTP | 3 or more HTTP calls over 500 ms each, one after another with gaps of at most 500 ms, saving over 2 s in parallel. |
| N+1 API Call | 10 or more GET calls to the same endpoint from a screen or page, each starting within 5 ms of the last, over 300 ms in all. |
| Large HTTP Payload | A response over 300 KB that took over 100 ms. Static files are left out; .json counts. |
| Endpoint Regression | A route's p95 over the last 24 hours is at least 50% and 200 ms above its 7 days before, with at least 100 requests in the 24 hours and 200 before. Checked hourly. |
| Web Vitals | One of the 5 pages with the most to gain has a vital rated needs improvement or poor over 7 days, with at least 10 samples. Checked hourly. |
Traces are read every 5 minutes. Each issue keeps the spans that matched, so its page shows the calls, and View trace opens the request. Resolve, ignore or assign them like any other issue. Patterns that need profiling (work on the main thread, frame drops, function regressions) aren't detected.
Cron monitors
Wrap a scheduled job, and every run is a trace:
import fictura
@fictura.monitor("nightly-digest", schedule="0 3 * * *")
def nightly_digest():
...fictura.monitor works on functions, async functions and as a with block, and sends what it recorded before the process exits. Performance → Jobs lists each cron with its last run, how long it took, its failures and its usual gap between runs. A cron with no run for more than twice its usual gap is shown as late.