A user taps Pay. The phone calls your gateway, which calls the payments service, which queries Postgres and calls a card processor. Somewhere in there, 2.4 seconds went. Five services each have logs with timestamps, and lining them up by eye is how incidents take an afternoon.
A trace is those five services on one timeline, nested in the order things happened, with the slow part obvious. Sentrinel builds that trace across every SDK it has โ Flutter, the browser, Node, Python, and anything that speaks OpenTelemetry โ because they all agree on one thing.
The one thing they agree on
The W3C traceparent header. Every Sentrinel client SDK puts one on the requests it sends to your backend, naming the trace and the span that made the call. Every backend SDK reads it and continues that trace instead of starting its own. That is the whole mechanism: no shared config, no agent, no vendor-specific header.
In practice:
- Flutter โ
Sentrinel.httpClient()(or Dio routed through it) records each call as a span and sendstraceparentto the hosts you list intracePropagationTargets. - Browser โ patched
fetchsends it to same-origin requests by default. - Node โ the plugin continues an incoming trace;
sentrinelFetchsends one onward, naming its own client span so the next service nests under it. - Django and FastAPI โ the middleware continues an incoming trace; the
httpxtransports andSentrinelSessionforrequestssend it onward. - Go, Rust, Java, anything else โ an OpenTelemetry exporter joins the same trace, because OpenTelemetry uses the same header.
The result is one waterfall: the tap on the phone at the top, the gateway's request under it, the payments service under that, the database query and the card processor call at the bottom.
Your hosts only
A trace id is not a secret, but it is yours. Sending traceparent to a third-party API leaks it to the vendor, and in a browser it turns a simple request into one that needs a CORS preflight โ which the vendor may not allow, breaking a feature that worked yesterday. So propagation is opt-in per host: same-origin by default in the browser, an explicit list on Flutter. Calls to other hosts are still recorded as spans on your side; they just do not carry your header.
The same list decides where the identity headers go โ x-sentrinel-consumer and x-sentrinel-device โ so the backend files server-side errors under the same signed-in user or guest install as the phone.
Spans that nest the way your code runs
Inside a service, spans nest automatically:
const risk = await traceSpan("fraud.check", async (span) => {
span.setAttribute("amount", amount);
return scoreTransaction(amount);
});
Anything wrapped runs as a child of whatever is already running, and the root is the HTTP request itself. One bug here was worth fixing loudly: the current span used to be one shared value, so two spans started concurrently โ Promise.all([traceSpan("a"), traceSpan("b")]) โ recorded b as a child of a. Each span now runs in its own async context, so concurrent work shows as siblings, the way it actually ran.
traced() wraps a function once, at its definition, and a synchronous function stays synchronous โ it used to come back as a Promise, which is the kind of surprise that makes people stop instrumenting.
Reading a waterfall
Click any span for its duration, status, attributes โ and self time. Self time is usually the number that matters: a 2.4-second POST /checkout that spent 2.3 seconds waiting on a child is not the problem; the child is. Spans are coloured by kind โ server, client, database, internal โ so the eye goes to the long database bar without reading labels.
Every service in the trace is a part of the same app โ the phone, the gateway, the payments service โ so when a trace crosses parts, the waterfall labels each span with the part it came from. One app's trace is one app's trace, not five dashboards.
And a trace is not only spans. From any trace, every log in this trace pulls the log lines every service wrote while serving it; from any error, the waterfall that produced it is one click away.
What it costs
Client spans from Flutter and the browser are sent in batches โ one post per flush, not one per span โ with a cap on posts in flight, so tracing does not double your app's request count or wake the radio for every call. Node traces are batched the same way. On the server, the SDK's work on the request path is an in-memory update; nothing waits on Sentrinel.
The setup for each side is in its reference: plugin, mobile, web, Django, FastAPI.