A dashboard that turns green while orders are stuck between a broker gateway and a venue is not useful observability. The signals must follow the trading path, distinguish a slow dependency from a failed one, and give the on-call engineer enough context to act. That means combining logs, metrics, traces and business events, rather than expecting one tool to explain every incident.
The practical choice is not whether to collect everything. It is which signal gives the fastest, safest answer for each failure mode, and what it costs in storage, network traffic and operational noise.
Start with the order path, not the tool
Map a representative order from client entry through authentication, pre-trade risk, order management, venue or liquidity-provider connectivity, and the client-facing acknowledgement. Include market-data ingestion and pricing if those services affect validation, margin or execution. For each boundary, record what enters, what leaves, and which component owns the transition.
Give each order a correlation identifier that travels through internal services and into relevant FIX tags or venue references where the protocol allows it. Keep the client order ID, internal order ID, venue order ID and execution ID distinct.
They answer different questions during cancel, replace and fill investigations. Record UTC wall-clock timestamps for cross-system comparison, plus monotonic elapsed-time measurements inside each process. Clock synchronisation helps, but wall-clock timestamps alone can misstate durations when clocks drift or step.
Set a latency budget by stage. A gateway may add only a small fraction of total order-to-ack time, while risk checks, serialization, network transit and venue processing add their own delays.
Measure these separately. A single end-to-end percentile cannot tell an engineer whether the queue, application or counterparty caused the increase.
Choose signals by failure mode
Metrics are the quickest way to see that a service or pathway has changed. They suit rates, queue depth, latency distributions, reject ratios, session state and market-data age. Logs explain individual decisions and errors. Traces show time spent across service boundaries, but need reliable context propagation and careful sampling. Business events provide a durable account of order state changes that can be reconciled against downstream records.
These methods overlap, but replacing one with another usually creates blind spots. Metrics can show a rise in rejects without explaining a particular order. Logs can show individual rejects but make a traffic-wide trend expensive to calculate. Traces make a slow request visible, but sampling may omit the exceptional order an operations team needs to inspect.
The figures below are typical market ranges for production systems, not audited results or universal targets. Use them as starting points, then tune for order volume, retention requirements and incident response needs.
| Signal | Typical collection range | Typical retention or sampling | Useful for |
|---|---|---|---|
| Service and trading metrics | 1-10 second scrape or aggregation | 15-30 days at full resolution | Latency, throughput, queue depth, session state |
| Structured application logs | Event-driven, buffered batches of 100-1,000 records | 7-30 days searchable | Risk decisions, rejects, state transitions, exceptions |
| Distributed traces | 100% for errors, 1-10% baseline sampling | 3-14 days | Time spent across internal service boundaries |
| Order and execution events | Every state change, persisted in sequence | 30-90 days operationally, subject to policy | Lifecycle reconstruction and reconciliation |
Keep metric labels bounded. Service, venue, region, environment and result code are usually safer dimensions than account ID, order ID or symbol. Unbounded labels can multiply time-series counts rapidly and make a metrics backend costly or slow. Put high-cardinality identifiers in logs or traces, where they can be queried for a specific incident. For further operational context, Trading Technology's infrastructure coverage follows the systems and providers that shape these choices.
Log decisions, not every packet
Structured logs should record a useful event, not reproduce an entire wire stream by default. For an order transition, include a timestamp, service and version, environment, correlation ID, state before and after, venue or route, result code, and elapsed time. For a risk decision, record the rule identifier and outcome. Avoid credentials, authentication tokens, full payment details and unnecessary client data. Apply retention and access controls to logs as operational records, not disposable debug output.
Raw FIX capture can help resolve protocol disputes or decode malformed messages, but it has higher storage and privacy costs. Enable it selectively by session or for a short, controlled window.
Redact sensitive fields before data reaches a central store. A sampled packet capture is not a substitute for reliable order-state events: it may miss a packet, and it does not prove that the application committed the corresponding state change.
A workable logging policy commonly sets:
- Info events for lifecycle changes and material decisions, with stable event names and identifiers.
- Warnings for recoverable conditions such as a retry, stale quote or rising queue, with rate limits to prevent floods.
- Error events for failed actions, including the dependency, error class and retry outcome.
- Debug detail as a temporary, access-controlled setting, not a permanent high-volume stream.
Use asynchronous buffering so a log collector outage does not block the order path. Bound the buffer and define what happens when it fills.
Dropping low-priority diagnostics may be acceptable; silently losing audit-relevant lifecycle events is not. Test both conditions under load.
Alert on customer impact and recovery
Page on conditions that require immediate intervention, not every metric that crosses a line. A useful alert identifies the affected service or venue, the observed symptom, the threshold duration and a runbook action. Separate a local component fault from a broad customer-impacting event. For example, a single disconnected backup session may warrant a ticket, while loss of the active route with a growing order queue may justify paging.
Thresholds should reflect a service objective and a baseline. Typical operational starting points include an alert when order acknowledgement latency exceeds its agreed percentile budget for 3-5 minutes, when market-data age breaches a feed-specific limit for 10-30 seconds, or when a queue grows continuously for 1-2 minutes. These are typical ranges, not universal limits. A fast-moving venue, an overnight session and a retail market open can have very different normal distributions.
Prioritise alerts such as:
- Order entry succeeds but acknowledgements or execution reports stop progressing.
- Reject, timeout or cancel-failure rates rise above a baseline, split by venue and route.
- Market data becomes stale, sequence gaps appear, or recovery does not complete.
- FIX sessions flap, reject logons or lose their active and standby paths.
- Risk, order or execution queues grow faster than they drain, or event processing falls behind.
- Logging, metrics or tracing pipelines lose data, so operators know when visibility is impaired.
Use a short persistence window to reduce transient noise, but do not delay an alert if a hard safety condition is breached. Pair symptom alerts with capacity and dependency warnings. Test alerts by injecting controlled faults, such as pausing a consumer or dropping a non-production session, and check that the page arrives with enough context to diagnose the issue. Track alert volume and time to acknowledge; repeated pages that do not lead to action need tuning.
Compare deployment models and assign ownership
A managed application performance monitoring service can speed up instrumentation and provide correlated metrics, logs and traces. It also introduces data egress, retention costs, vendor-specific agents and questions about where trading data is processed.
A self-managed open-source stack gives control over storage and access, but the firm owns upgrades, scaling, alert routing and recovery of the observability platform itself. Native broker, exchange or venue dashboards can expose session and execution details unavailable elsewhere, but often stop at that provider's boundary.
Most firms use a combination. Keep durable order events and compliance records in systems designed for retention and reconciliation. Use metrics for fleet health and fast alerting, logs for decisions and errors, and traces for selected cross-service investigations. Vendor dashboards remain useful for provider-side status, but should not be the only source of truth for internal queues or client impact. The platform mix and operating trade-offs are recurring subjects in Trading Technology's reporting.
Assign ownership for each signal: who defines the event schema, who tunes thresholds, who can access sensitive records, and who is paged when a pipeline fails. Review dashboard and alert changes alongside releases. A deployment that changes a service name, metric label or trace propagation can break an alert without changing the trading code's apparent behaviour.
This advice does not apply in full to a low-volume internal simulator or a single-process tool with no live customer orders, where structured logs and a few health checks may provide enough visibility without distributed tracing or a large metrics platform.
Perguntas frequentes
What should a broker log for each order?
Record the order's correlation identifiers, timestamp, service and version, state transition, route or venue, result code and processing time. Keep client, internal and venue identifiers distinct. Exclude credentials and unnecessary personal or financial data.
Should trading systems use logs or metrics for latency?
Use metrics to track latency distributions and alert on changes across a service or route. Use structured logs or traces to investigate individual slow orders and locate the stage responsible. Neither signal alone provides both fleet-wide trends and detailed context.
How often should trading infrastructure metrics be collected?
A typical starting range is a 1-10 second collection interval for service and trading metrics. Faster collection adds load and storage cost, while slower intervals can hide short incidents. Set the interval according to the system's latency budget and alert response needs.
Which trading system alerts should page an engineer?
Page on actionable conditions with likely customer or trading impact, such as stopped acknowledgements, a failing active venue route or an order queue that keeps growing. Use tickets or dashboards for isolated warnings that do not need immediate intervention. Include the affected component and a runbook action.
Is distributed tracing necessary for every trading system?
No. Tracing is useful when requests cross multiple services and metrics or logs cannot show where time is spent. A small single-process system may be served by structured logs and health metrics, while a distributed production order path benefits from trace context at service boundaries.
Plataformas · Software · Provedores · Mercados