Skip to main content

Distributed Trace Reference

Distributed Traces searches the traces of the environment selected and shows each one as a timeline of spans.

Rationale: What traces are for.

Trace Instrumentation​

Tracing comes from camel:opentelemetry2, part of every integration. Spans are exported over OTLP with the resource attributes service.name, service.namespace and deployment.environment. Nothing is declared in the routes.

What a trace contains​

A trace is a tree of spans. Each span is one piece of work with a start, a duration and a status.

SpanRepresents
Server spanThe exchange started by a consumer endpoint such as platform-http, kafka or timer
Child spansThe endpoints the route sends to, such as http, kafka or sql

The trace context is propagated on outgoing calls. An integration called by another, or behind the gateway, continues the trace it receives instead of starting a new one.

Reading a timeline​

The shape of a trace usually points at the cause of a slow request.

PatternLikely cause
One long child spanThe system called is slow
A long parent whose children are shortTime spent in the route itself: transformation, aggregation, waiting on a thread pool
Many short sequential childrenCalls made one by one that could be batched or made in parallel
A span in error with no childThe failure happened before any outgoing call: validation, marshalling
Start from the slowest

Sort traces by duration and open the slowest of the period. One slow trace usually shows the pattern behind a degraded average.

From a trace to its logs​

Log entries written during an exchange carry its trace identifier. Search that identifier in Logs Insight to read what the route logged for that request.