Structured Logging and Run IDs
Structured logs with run IDs and trade IDs turn production errors into actionable, traceable events.
Explanation
Structured logging records events as key–value pairs, including identifiers such as run_id, trade_id, and snapshot_id.
Consistent fields across services make it easy to filter logs for a single valuation run or problematic trade.
Run IDs and context-rich error messages allow engineers to reproduce, debug, and fix production issues quickly.
loggingobservabilityrun-idtraceability
Interactive visualisation
Structured logging and run IDs
Turn errors into traceable events.
Current run_id
run_d4538a
Key idea: every log line is queryable because fields are consistent: run_id, trade_id, event, level.
10:14:16INFO{"run_id":"run_d4538a","trade_id":"-","event":"valuation.start"}
10:14:17INFO{"run_id":"run_d4538a","trade_id":"t_d1bcab","event":"trade.load"}
10:14:18INFO{"run_id":"run_d4538a","trade_id":"t_d1bcab","event":"pricing.ok"}
10:14:19INFO{"run_id":"run_d4538a","trade_id":"t_bb4961","event":"trade.load"}
10:14:20INFO{"run_id":"run_d4538a","trade_id":"t_bb4961","event":"pricing.ok"}
10:14:21INFO{"run_id":"run_d4538a","trade_id":"-","event":"valuation.end"}
Interpretation
- Without run IDs you debug “the system”. With run IDs you debug one run.
- Trade IDs turn incidents into a reproducible unit of work.
- Errors should be actionable: include the missing artefact and the context.