Event Logging & Audit Trail
A permanent, queryable record of everything that happened — and who did it.
Every significant action across the platform is logged as a structured event — temperature alarms, container movements, robot online/offline transitions, sensor battery warnings, firmware updates, and operator actions. Events are first-class records: severity-tagged, entity-linked, timestamped, and queryable. The audit trail is what turns 'something went wrong yesterday' into a verifiable answer.
Structured event model
Every event carries a type, severity, originating entity reference (robot, sensor, container, user, controller), timestamp, and a typed payload. No free-form log lines — every event is queryable, filterable, and exportable.
Severity levels
INFO, WARNING, ERROR, and CRITICAL severities, with per-severity filtering and routing. Critical events surface immediately on dashboards and trigger Alertmanager notifications; informational events accumulate quietly for after-the-fact review.
Entity-linked records
Each event is anchored to the entity it concerns — a specific robot, sensor, container, or user. Drill into any entity in the UI to see its complete event history without writing a query.
Monthly PostgreSQL partitioning
The event table is automatically partitioned by month, keeping query performance flat as the log grows into the millions of rows. Partition creation runs as a Celery Beat task with no manual maintenance required.
Retention management
Configurable retention policy auto-creates future partitions and cleans up expired ones. Set a retention window appropriate to your compliance regime; older partitions can be archived off to cold storage before deletion.
Operator attribution
Events generated through user actions carry the operator identity end-to-end. Combined with role-based access control, this gives a complete chain-of-custody record for every manual override, configuration change, and reset.
What gets logged
- Robot fleet — online/offline transitions, configuration pushes, firmware queue and apply, remote-session start/end.
- Sensors — alarm threshold breach and recover, sensor offline, battery low, payload-decode failures.
- Containers — bay assignment, movement, weight and temperature captures, cultivar / batch association changes.
- I/O controllers — significant state-machine transitions, register write overrides, protocol errors.
- Users — login, logout, role change, permission grant or revoke, manual override actions.
Browsing & filtering
The audit log UI supports filtering by entity, severity, time range, event type, and operator. Common views (e.g. all CRITICAL events in the last 24 hours) can be saved per user. Every list view exports to CSV or JSON for offline review and submission to auditors.
Schema and storage
events (parent table)
├── events_2026_05 ← May 2026 partition
├── events_2026_04 ← April 2026 partition
└── … monthly partitions, auto-created by Celery Beat
Time-bounded queries (the most common pattern) hit a single partition and stay fast even with hundreds of millions of historical rows. PostgreSQL’s native partition-pruning and TimescaleDB’s compression policies keep storage cost predictable.
Integration with the rest of the platform
- Alerting — CRITICAL events route to Alertmanager via Prometheus alert rules, so the audit log and alerting pipeline never disagree.
- Dashboards — Grafana panels visualise event rates by type, severity, and entity, surfacing creeping problems before they escalate.
- Tracing — high-severity events embed an OpenTelemetry trace ID, so an audit-log entry links straight to the underlying request in Zipkin.
- Exports — CSV and JSON exports support traceability programmes (citrus, pome, stone fruit) and compliance submissions.
Why it matters
Compliance doesn’t ask whether something happened — it asks whether you can prove it. A structured, partitioned, retention-managed audit trail means you can answer that question without combing through container logs or reconstructing events from scratch. It’s also the difference between a near-miss being a learning opportunity and being a guessing game.
Back to Software · Contact us for a deployment discussion.
