← Back to blog
Solution 4 min read 炬鲸团队

Observability for Financial Trading Systems: Tracing and Audit Compliance

An observability plan for financial trading systems: full tracing for money-related failures, the retention/tamper-evidence/searchability requirements of audit logs, business-metric alerting mapped to loss, and a compliance checklist.

Financial observability has one extra requirement: compliance

E-commerce cares about "fast and stable"; financial trading systems carry one more hard constraint on top — regulatory compliance. Every transaction needs a complete audit trail, logs must be retained long-term and be tamper-evident, and any problem must be traceable back to "who did what and when". In finance, the observability system isn't just an ops tool; it's part of the audit and compliance infrastructure. That means collection, storage, and retrieval all have to be designed to compliance standards — you can't just reuse the internet-company playbook.

Concretely, that means three things: classify data before it lands in storage (public, internal, sensitive, restricted), apply the strictest controls to the restricted tier, and make the classification itself auditable — an auditor should be able to see, per log stream, what classification it carries and why. The classification, not the engineer's memory, is what drives masking, retention, and access-control decisions.

Full tracing: locating money-related failures

A transfer passes through five or six systems — channel, routing, account, risk, settlement — and any error or timeout in any of them can cause a funds mismatch. The worst outcome for these failures is "we can't tell whether the money actually moved". Full tracing fixes that: give every transaction a unique trace_id, stitch the cross-system calls together, and you can reconstruct exactly which step stalled and which step returned an error code.

The key config: 100% sampling on the transaction main path, no downsampling. It costs more, but you never want to face a funds-related failure and hear "that trace wasn't sampled."

Audit logs: retention, tamper-evidence, searchability

Financial audit logs have three hard requirements:

  • Retention: 5-15 years depending on regulation, with hot/cold tiering — hot data queryable near-real-time, cold data archived to object storage.
  • Tamper-evidence: immutable after write, guaranteed by WORM (write-once-read-many) storage plus a hash chain.
  • Searchability: auditors need multi-condition queries by operator, time, transaction ID, and operation type.

OBSERVE's audit-log module makes these three out-of-the-box: logs are read-only after write, each line carries an integrity hash, and query permissions are role-based — the audit role can query but can't change config.

The hash chain, in practice

Each audit entry stores the hash of the previous entry alongside its own content hash. To verify integrity you recompute the chain from the head and compare — any tampering breaks every subsequent link, so a single altered record is detected even if the attacker also modified the record itself. Run the check on a schedule and on demand; auditors generally want a signed verification report, not a green checkbox.

Alerting: map metrics to money loss

Financial alert thresholds can't stop at technical metrics; they have to map to business consequences. "Payment success rate below 99.9%" is far more direct than "error rate above 1%" — the former means money loss, the latter is just a technical symptom. Build the key metrics in business terms:

  • Transaction success/failure rate (by channel, by merchant).
  • Per-transaction P99 latency — timeouts get cancelled or retried by users, and retries can cause double charges.
  • Reconciliation differences — a T+1 reconciliation mismatch means a missed or wrong entry.

Aggregate these at second-level granularity and attach trace samples to the alert, so the on-call person opens the alert and sees the full chains of those failed transactions. The point is to make every page actionable: an alert that can't be traced to a transaction is an alert that will eventually be ignored.

A compliance-retention checklist

  • Do data classification at ingestion: card numbers, ID numbers, and passwords must never appear in plaintext in logs — mask them at the collector.
  • Store audit logs and business logs separately, with separate authorization.
  • Build a log-integrity check and periodically verify hashes.
  • Define retention and destruction policies, and destroy expired data with a destruction record kept.

One more thing: the T+1 reconciliation loop

Reconciliation isn't a one-off — it's a daily feedback loop. When T+1 reconciliation finds a mismatch, the trace_id on both sides of the ledger should be the first thing you compare. If the settlement system recorded a different trace than the payment system, you've found a split-brain at the boundary between two systems, and tracing is the only cheap way to see both sides at once.