Skip to content

Observability

Enroute's observability is distributed tracing. Each node exports OpenTelemetry traces over OTLP to the collector that [telemetry] names, and one trace follows a request across the compute node, the ledger nodes, and your hook endpoint. Rates, latencies, and errors come from those spans in your tracing backend, so Enroute exports no separate metrics. Without a [telemetry] table, spans are written only to the console.

toml
[telemetry]
endpoint = "https://otlp.example.com/v1/traces"
sample_ratio = 1.0

[telemetry.headers]
authorization = "Bearer ${OTEL_TOKEN}"
"x-dataset" = "enroute"
KeyDefaultMeaning
telemetry.endpointnoneFull OTLP traces URL
telemetry.headersnoneCollector headers; values are secret
telemetry.sample_ratio1.0Head-sampling ratio from 0.0 to 1.0

Invalid ratios or header names stop startup. RUST_LOG controls console logs; exported spans retain an INFO minimum level. A background thread writes console logs to stdout, so a slow terminal or pipe does not slow requests. If that thread falls behind by a full buffer of lines, new lines are dropped.

The actor from authorize is attached to the span, so use an internal identifier rather than a credential or email address.

Traces

Each Git request is one trace. Its root span, enroute::git::request, has the repo, the git.service and the response status. A fetch's span ends when its pack is sent. Under the root, a push has a span for each stage:

SpanWhat it covers
enroute::push::receiveThe spool of the body and the pack's first pass
enroute::push::ingestThe pack checked against the repository
enroute::hooks::pre_receiveThe pre-receive hook
enroute::push::landThe commit of the ref updates
enroute::commit::publish_layerThe upload of the new layer
enroute::commit::proposeThe proposal to the ledger
enroute::ledger::callA call to the ledger, with its rpc.method
enroute::hooks::post_receiveThe post-receive hook

A fetch has enroute::fetch::plan and enroute::fetch::write_pack.

Calls from a compute to a ledger node, and to the hook endpoint, carry W3C trace context (traceparent). The ledger node continues the trace in enroute::grpc::server, enroute::ledger::propose and enroute::ledger::replicate, so one trace shows a push on both nodes. A traceparent that a proxy sends with a Git request makes the request part of the proxy's trace. Calls between ledger nodes are not traced.

Each node names itself with these resource attributes:

AttributeValue
service.nameenroute
service.versionThe Enroute version
service.instance.idnode.advertise_url, or else node.internal_listen
enroute.roleboth, ledger or compute

Use service.version to compare the nodes of each version during an upgrade. OTEL_RESOURCE_ATTRIBUTES adds more attributes. At a stop, a node exports the spans that it has not sent yet.

Background work, such as flushes, compaction, and the layer sweep, is not traced. Enroute logs its failures. See What to watch.

Timing logs

To see where a request spends its time, turn on debug logs for these targets. Each line gives the times in microseconds (*_us). The fields can change in any release.

TargetWhat it times
enroute::request_timingEach Git request, and the spool of a push body
enroute::push_timingThe stages of a push
enroute::read_timingLinearizable reads: the follow, the read barrier and the catch-up
enroute::ledger_callEach call from a compute to the ledger, split into network and handler time
enroute::ledger_timingRounds and apply batches on a ledger node
sh
RUST_LOG=info,enroute::push_timing=debug

With enroute::ledger_call on, calls to the ledger carry x-enroute-*-us metadata so that the two nodes can split the time.

Node status

Each node serves GET /status on its internal listener, node.internal_listen (0.0.0.0:7400 by default). The response is JSON diagnostics of each role that the node runs: the compute's repository views and storage, and the consensus engine under consensus. The fields are for people and can change in any release. Do not parse them in automation.

sh
curl http://127.0.0.1:7400/status

A ledger node also serves GET /status/repos/<repo>: what the node knows of the repository's log. The response has the node ID (node), the sequencer that the node knows of (sequencer, or null), the log's term, whether the node sequences the log (leading), and the version of the state that the node has. A node that does not host the log answers 404.

sh
curl http://127.0.0.1:7400/status/repos/acme/widgets

Each node answers from its own view. A paused or partitioned sequencer still says that it leads. To find the sequencer, ask each ledger node, and take the sequencer that a majority names at the highest term.

The Git and API listeners do not serve /status. The internal listener also carries the gRPC between ledger nodes, so keep it reachable only inside the cluster. For a liveness check from outside, use GET /healthz on the Git listener.

What to watch

Watch requests through their traces, and the rest of the system through the signals that follow:

SignalWhereAct when
Request rate, errors, and latencyThe enroute::git::request spans (http.response.status_code) and the enroute::grpc::* spans, in your tracing backendErrors rise, or latency rises. The child spans show which stage is slow
ERROR log linesEach node's consoleAny appear. A failed flush, merge, sweep, or API call logs one, with the cause
enroute diagnose exit statusA ledger node, on a scheduleIt exits with status 1. Its output names the check that failed
A member that is not aliveenroute diagnoseA node is down. If its disk is lost, replace it
consensus.engine.lagging_logsGET /status of each ledger node, read by handIt stays above 0 after a node change. A replica is not catching up
Push latencyThe enroute::push::land and enroute::commit::propose spansIt rises. A commit waits for the ledger disks to sync, so check their sync latency
GET /healthzEach compute node's Git listenerIt does not answer 200. Use it for the load balancer's health check
Ledger disk space and sync latencyYour host or cloud metricsSpace runs low, or sync latency rises
Object store errors and throttlingYour provider's metricsErrors or throttled requests rise

/healthz says only that the process serves HTTP. It does not check the ledger or the object store: a compute node that cannot reach the ledger still answers 200. Use enroute diagnose for those.

Run enroute diagnose from automation and use its exit status. Do not parse its output or the /status fields: they are for people, and they can change in any release.

Generated from docs/operate/observability.md at 11fd62b