Add OTLP metrics for workers, gRPC, the scheduler, store tiers and health - #2687
Merged
amankrx merged 1 commit intoAug 14, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
amankrx
marked this pull request as draft
August 13, 2026 05:10
amankrx
force-pushed
the
feat/worker-fleet-otlp-metrics
branch
from
August 13, 2026 05:38
8b9e28b to
e56d976
Compare
amankrx
marked this pull request as ready for review
August 13, 2026 07:24
amankrx
force-pushed
the
feat/worker-fleet-otlp-metrics
branch
from
August 13, 2026 07:24
e56d976 to
b9a6242
Compare
amankrx
force-pushed
the
feat/worker-fleet-otlp-metrics
branch
from
August 13, 2026 12:26
b9a6242 to
83f23b1
Compare
amankrx
force-pushed
the
feat/worker-fleet-otlp-metrics
branch
from
August 14, 2026 02:27
83f23b1 to
a5eebe9
Compare
amankrx
force-pushed
the
feat/worker-fleet-otlp-metrics
branch
from
August 14, 2026 03:11
a5eebe9 to
c4e170a
Compare
amankrx
force-pushed
the
feat/worker-fleet-otlp-metrics
branch
from
August 14, 2026 03:39
c4e170a to
3c4bd22
Compare
amankrx
force-pushed
the
feat/worker-fleet-otlp-metrics
branch
from
August 14, 2026 04:01
3c4bd22 to
c0fda8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Fixes #2614. NativeLink had OTLP metrics for cache and execution only. Everything else lived in the older
#[metric]system or nowhere.Adds the missing categories: workers (connected, connects, disconnects, keepalives, paused/draining), gRPC (one duration histogram by service, method and status, giving rate, errors and latency together), scheduler matching duration, fast/slow store tier hits and bytes, and health check results.
Also the two execution metrics dropped in #2599 for want of a data source. Memory comes from
ActionResourceUsage.peak_memory_kb, which the worker already reported. CPU time is new: the worker samples/proc/<pid>/statfor the process group every 250ms already, so it now readsutime/stimefrom the same line and reports it ascpu_time_ms.Connection pools are covered too: free slots at acquisition, whether a caller had to queue, and Redis reconnects. A pool that keeps reporting zero free slots is the bottleneck whatever the latency elsewhere says.
Nothing is labelled by worker id or action digest; both grow without bound.
How this was verified
Unit tests for the metric helpers, the gRPC path splitter, the health status labels, and the
/proc/<pid>/statCPU parser.Risk
Moderate, mostly in accounting rather than behaviour.
CPU time is cumulative per process and a process that exits disappears from
/proc, so the sampler keeps the last value per pid and totals them at the end rather than summing the live group.cutime/cstimeare excluded, since they only cover reaped children and would double count.Worker counts are per scheduler instance; with several schedulers the fleet total is the sum. They are exact by construction: unbounded LRU so nothing is silently evicted, one removal path, and re-adding an id does not double count.
gRPC status comes from response headers. Tonic puts it in trailers when a call fails mid-stream, and trailers are not reachable from that layer without consuming the body, so error rate undercounts mid-stream failures. Rate and latency are exact.
The proto gains
cpu_time_msat tag 5, a new optional field, so an old worker reports zero.Nothing from #2614 is left out.
This change is