Monitoring
Data health
Section titled “Data health”Manage → Data health summarizes the state of the catalog:
- Summary cards: outdated records, active records, stale records, and relationships pointing at deleted records.
- Storage: size per table and in total.
- Blueprint health: per blueprint, how many records there are, how many are outdated or stale, and the oldest update.
- Freshness distribution: how recently values were updated.
- Default completeness: how many records have every field their schema requires in the default context.
- Context coverage: how many records have their own values in each context.
- Relationship integrity: links whose target has been deleted.
Stale after sets what counts as stale, from 1 to 3650 days (90 by default). Results are cached for five minutes by default (DATA_HEALTH_CACHE_TTL_SECONDS); Refresh clears the cache.
When an extension exports records, the Exports card counts the records each destination rejected, could not confirm, or is retrying, next to the synced ones. To see and retry those records, open the extension’s page under Manage → Extensions; see Export status.
Extensions can add cards to this page.
Background processing
Section titled “Background processing”Manage → Background processing shows the API’s task queue per task type: queued, running, failed, expired leases, and how long the oldest due task has waited. It refreshes every 30 seconds.
- Queued includes retries scheduled for later.
- Expired leases are tasks whose worker stopped responding; another worker picks them up.
- Failed are dead letters that need attention.
File processing has its own queue and is not shown here; watch it through metrics.
Metrics
Section titled “Metrics”Both processes expose Prometheus metrics. Keep them on a private network.
| Process | Endpoint | Access |
|---|---|---|
| API | GET /api/metrics |
Authorization: Bearer <token>, the api_metrics_token secret. Metrics cover every workspace, so sessions and personal tokens are refused. Without the secret the endpoint stays closed. |
| File worker | GET /metrics on the operations listener (port 3001) |
Authorization: Bearer <token>, the file_worker_metrics_token secret. |
Labels are bounded: routes are reported as templates, and no file name, ID, or URL is ever a label. The only series labelled by workspace is attricat_event_delivery_queue_depth (workspace_id).
Useful series:
| Series | Watch for |
|---|---|
attricat_database_ready, attricat_file_worker_database_ready, attricat_object_store_ready |
Zero for two probe intervals. |
attricat_task_queue_depth, attricat_task_queue_oldest_age_seconds, attricat_task_queue_retries |
Growing depth, old tasks, any dead letters. |
attricat_file_worker_queue_depth, attricat_file_worker_oldest_age_seconds, attricat_file_worker_retries |
Same, for file processing. |
attricat_file_worker_jobs_failed_total |
Increases. |
attricat_event_delivery_queue_depth{workspace_id,consumer,status} |
Growing pending, any dead_letter. |
attricat_event_deliveries_total{outcome} |
dead_letter increases. |
attricat_extension_operation_runs, attricat_extension_operation_oldest_age_seconds |
Stuck extension operations. |
attricat_file_uploads_total, attricat_file_downloads_total, attricat_object_store_operations_total |
Error outcomes. |
attricat_retention_cleanup_total{family,outcome} |
failed. Repeated budget_exhausted for a family means each cleanup run ends with old data of that kind still left to delete; raise RETENTION_SWEEP_BUDGET_SECONDS. A domain_events backlog that never shrinks usually means a dead-lettered delivery or a stalled consumer. attricat_retention_rows_purged_total{family} counts deleted rows. |
attricat_upload_cleanup_total{outcome} |
failed. Failed deletions of abandoned uploads are retried. |
attricat_query_cache_requests_total{namespace,outcome} |
A falling share of hit and remote_hit against miss. |
attricat_query_cache_redis_connected |
0 on any replica: it has lost its Redis connection and caches in memory only until it reconnects. |
attricat_query_cache_redis_circuit_opened_total |
Increases: Redis is connected but keeps timing out or dropping commands, so replicas skip it for a few seconds at a time. |
attricat_db_round_trips_per_operation{scope} |
Rising database round trips per request route, task kind or background loop. |
attricat_db_round_trips_total{scope} |
A growing unscoped rate, or a background loop whose rate rises while the catalog is idle. |
The event delivery gauge is refreshed every five seconds. For each consumer with deliveries in a workspace, all four statuses are reported, and statuses without deliveries read 0.
Each request route, task kind and background loop is a round-trip scope. To log the count for every operation, set RUST_LOG=attricat_repository::round_trips=debug.
Suggested alerts: page when a readiness gauge is zero for two intervals, when any dead-letter or failed count is above zero, or when failure counters increase. Warn when the oldest queued item is older than five minutes for ten minutes, or a queue grows for fifteen minutes. Alert if metrics disappear for two scrape intervals. Tune thresholds to your import and export volume.
Memory use
Section titled “Memory use”As a baseline, this is what one API process, one file worker and PostgreSQL used on a single amd64 machine with 5,000 records and one extension. These are the highest values docker stats showed in each activity, which leaves out the file cache. Treat them as a starting point, and compare with your own catalog and traffic.
| Activity | API | File worker | PostgreSQL |
|---|---|---|---|
| Idle after starting | 45 MiB | 3 MiB | 100 MiB |
| Searches and reads from 16 clients | 300 MiB | 3 MiB | 310 MiB |
| Saves that run an extension, from 8 clients | 310 MiB | 4 MiB | 510 MiB |
| Processing 24 images of 6 megapixels, 3 at a time | 400 MiB | 300 MiB | 510 MiB |
| 16 sign-ins at once, four times | 810 MiB | 100 MiB | 550 MiB |
Password hashing causes the largest jump, and the API held on to that memory for at least the 90 seconds measured afterwards, so a high value after a burst of sign-ins doesn’t by itself mean a leak. Keep the 2 GiB limit from the production checklist. Larger images need more file worker memory, up to FILE_WORKER_MAX_PIXELS, which this baseline didn’t reach.
Request timing
Section titled “Request timing”Every API response has a Server-Timing header with the total handling time (app;dur=…). Browser developer tools show it under the request’s timing. Data-health responses also say whether the cache was hit.
Logs and traces
Section titled “Logs and traces”The API and file worker log structured events controlled by RUST_LOG. Each request has an x-request-id, returned in the response and recorded in the audit log, so you can find the log lines for a change someone reports.
Set OTEL_EXPORTER_OTLP_TRACES_ENDPOINT to send traces to an OTLP/gRPC collector.
Logs and traces never contain object keys, file names, passwords, or tokens.
Failed event deliveries
Section titled “Failed event deliveries”Attricat changes produce internal events that workflows, rules, and extensions consume. A delivery that keeps failing becomes a dead letter after five attempts by default.
-
List dead letters (needs
data_health.read):Terminal window acli event dead-lettersEach entry has the consumer and event IDs, the consumer name, event type, attempt count, failure time, and last error.
-
Fix the cause: the extension, the external dependency, or the data.
-
Make sure running the handler again is safe.
-
Replay the delivery (needs
roles.manage):Terminal window acli event replay <consumer-id> <event-id>
Replaying a rule or workflow delivery does not reset its attempt count, so if it fails again it goes straight back to dead letter. An extension delivery starts again with five new attempts. Don’t replay the same delivery repeatedly without fixing the cause.
Rule and workflow runs and extension operations have their own dead letters and replay commands; see Rules, Workflows, and Operations.
Retrying file processing
Section titled “Retrying file processing”A file whose processing failed permanently can be queued again:
docker run --rm --env-file attricat.env ghcr.io/attricat/attricat@sha256:… file-worker --retry <job-uuid>