Audit, traces and logs
FlowCatalyst keeps several records of what happened, each for a different question:
| Record | Answers | Always on? |
|---|---|---|
| Audit log | Who changed what, when, and on whose behalf | Yes |
| Login attempts | Who tried to sign in or get a token, and whether it worked | Yes |
| Dispatch jobs and attempts | What was delivered where, and what the consumer said | Yes (dispatch jobs) |
| Traces | What a function or an ingestion actually did, step by step | No: switched on by an operator for minutes |
| Logs and metrics | How the processes are doing | Yes, with repeated failures summarised |
The design rule across all of them: record facts always, record detail only on request, and never fail silently.
The audit log
Section titled “The audit log”Every administrative change on the platform writes an audit row in the same transaction as the change itself: the entity, the operation (with its input), the principal, the application and the client, and the time. A change that commits always has its audit row; a change that rolls back never does. This comes from the write path: a use case’s plan is applied together with its event and its audit row, or not at all.
Applications add their own entries the same way they publish events: through the outbox, in the
transaction of their own business change, relayed to POST /api/audit-logs/batch. So an
application’s admin actions sit in the same trail as the platform’s.
A few things are audited specially:
- Secret reveals are audited (who, which property, on whose behalf, never the value), and a reveal that cannot be recorded is refused (configuration and secrets).
- Switching a trace on or off is audited, because it decides what sensitive detail is captured.
- Secret fetches by an ingestor runtime are the exception: a runtime re-reads its secrets about once a minute, so a successful fetch is recorded as security telemetry (a log line, a counter and a “last fetched” record) instead of an audit row. A refused fetch is audited.
Login attempts
Section titled “Login attempts”Every interactive sign-in and every token request by a service account (or by a developer using their own self-service credential) records an attempt: who, from where, the outcome and the reason for a failure. The same records drive login backoff, which slows down repeated failures for an identifier and address, so the history is both an audit trail and a defence.
Login attempts are kept in quarterly partitions and dropped after three years. Field-worker sign-ins
have their own history, kept 90 days by default (FC_FIELD_LOGIN_ATTEMPT_RETENTION_DAYS).
Traces: gated and time-boxed
Section titled “Traces: gated and time-boxed”Logging every request and response all the time is expensive, slow and a privacy risk, and it is still not there when you need it from last week. Traces take the other approach: nothing is captured until an operator switches tracing on for one function context or one ingestion, for a short window. The rest of the time a trace call is a cheap no-op.
stateDiagram-v2 [*] --> Off Off --> Live: operator switches on (audited) Live --> Off: window ends by itself Live --> Off: operator switches off (audited) Live --> Live: capture sampled calls or polls
Function traces
Section titled “Function traces”A function writes to named contexts that it declares in code (for example orders), with a
business reference (an order or trip number) that stamps every later record of the call. One
context, http, is built in: while it is on, each call also records its request, response, timing
and outcome, and everything the call logged.
| Rule | Value |
|---|---|
| Longest window for a declared context | 60 minutes (FC_FUNCTIONS_TRACE_MAX_MINUTES), or “until switched off” with a separate permission, still ending after 7 days |
Longest window for http |
15 minutes, never indefinite, because it captures bodies |
| Sampling | One call in N, decided per call, so a captured call is captured whole |
| Volume | At most 200 records a second per function per platform process; the excess is dropped and counted |
| Retention | 30 days from when the platform stored the record |
A switch takes effect within about a second. Records are queued in the runner and shipped in the background, so they survive whatever happens to the call, and tracing never blocks or fails a call.
Ingestion traces
Section titled “Ingestion traces”“The ingestion is running but nothing shows” is the question an ingestion trace answers. Switching tracing on opens a window of 1, 5 or 15 minutes. Each runtime captures from the moment it first learns of the window (at its next sync), and the platform refuses records dated after a hard stop. A capture is one whole poll cycle or one whole exchange, with every HTTP call it made; by default a runtime starts at most one capture per ingestion every 5 seconds. Empty polls are recorded too, and even without tracing every runtime reports how many polls it finished and when, so “polling, nothing new” is visible. Ingestion trace records are kept 7 days.
Credentials stay out of traces
Section titled “Credentials stay out of traces”Traces exist to show what was sent and received, which is exactly where credentials live. Before a
record is stored (for ingestions, before it leaves the runtime) the values of headers whose names
contain auth, key, token, secret, password, signature, cookie or session are
replaced by [redacted], as are sensitive query parameters (for ingestions and Java functions,
every query value except paging and time-window ones). The secret values an ingestion or a Java
function was given, and credentials obtained while running (a session token from a login call),
are removed wherever they appear, a URL’s path included.
Reading is split in two. …:trace:view shows a record’s metadata (time, context, status, duration,
sizes); …:trace:view-bodies is needed for headers, query strings, bodies and log lines, and to
switch on the capture of bodies. The read-only viewer roles hold neither: trace records contain
what functions printed and business keys, so only the roles that operate functions and ingestions
read them.
Failure pacing: never skip silently
Section titled “Failure pacing: never skip silently”A source that fails every poll, or a platform that is briefly unavailable, can turn into a tight retry loop that floods the logs and the bill. FlowCatalyst paces repeated failures instead:
- Back off. A polled ingestion that fails in a row waits 5 seconds, doubling up to 5 minutes, with jitter. While the platform is not taking jobs, every ingestion on the runtime waits and one probe tests the platform.
- Log once, then summarise. The first failure of a streak is logged in full, with its stack trace; after that, at most one line a minute with a count. The first success ends the streak and says so. A Java function’s own log is budgeted (100 lines a second by default) for the same reason.
- Stay visible. Pacing changes how often something is tried and logged, never whether the failure is shown. Failures, notices and health stay on the platform the whole time. An ingestion nobody is running shows as “not running”, and a function whose signing account is gone refuses deliveries and says why rather than quietly using another account.
Why “never skip silently”. A failure that is retried quietly forever, or dropped with a debug line, is found weeks later by the business, not by the operator. Every component is built to fail loudly once, cheaply after that, and visibly the whole time.
Read next
Section titled “Read next”- Switch on trace logs and read them (functions).
- Failures, notices and traces (ingestions).
- Monitoring and alerting and the metrics reference.
- Security model.
- Decisions: tracing is gated and time-boxed, failures are paced and visible.