Skip to content

engine: keep exemplars off exec resource gauges - #14982

Closed
sipsma wants to merge 1 commit into
mainfrom
sipsma/exec-gauge-exemplars
Closed

sipsma wants to merge 1 commit into
mainfrom
sipsma/exec-gauge-exemplars

Conversation

@sipsma

@sipsma sipsma commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Each exec's resource gauges (CPU, memory, disk I/O, network, pressure) record through the session's meter provider. The OTel SDK gives every new attribute set a reservoir of GOMAXPROCS exemplar slots, and every exec has its own attribute set, since its span ID is one of the attributes. So each exec series allocated a reservoir that was reset at every collection, though nothing uses the exemplars: the exec's trace and span IDs are already on every point as attributes.

This adds a view on the session's meter provider that gives the exec resource gauges' scope (dagger.io/engine.buildkit) a reservoir that keeps nothing. Names, units, aggregation and values are unchanged, and other instruments keep their exemplars. The view applies to every reader of the provider, including the Cloud reader that #14930 moved to delta temporality.

Measured on a cold build of dagger's CLI with per-package Go builds (one 16-vCPU Graviton machine, 2 profiled and 4 timed runs per arm, against the same base without the change):

  • about 85 MiB less engine allocation per cold build: the exemplar and aggregation frames fall from 92 MiB to 5–9 MiB. Edits and unchanged rebuilds were already near zero.
  • no detectable wall-time change: cold build −0.23 s median (95% interval −0.69 to +0.45 s); edits and unchanged rebuilds within ±0.1 s.

These gauges' points no longer carry exemplars.

TestResourceMetricsViewDropsOnlyExecExemplars checks that an exec gauge's point keeps its value and has no exemplars, while a gauge in another scope still records one. It fails without the view.

@sipsma
sipsma force-pushed the sipsma/exec-gauge-exemplars branch from 0717732 to 962d2a1 Compare October 30, 2026 19:02
Each exec's resource gauges already carry its trace and span IDs as
attributes. Their default exemplar reservoirs held GOMAXPROCS slots per
exec series and were collected every interval, though nothing reads the
exemplars. A view on the session's meter provider gives that scope a
reservoir that keeps nothing; metric values are unchanged.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma

sipsma commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #15007, which carries this commit unchanged as part of the engine performance batch.

@sipsma sipsma closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant