otel-observable-handles-rust
Installation
SKILL.md
OpenTelemetry Rust observable-instrument handle leak
The bug
In opentelemetry-sdk 0.27 through (at least) 0.31, calling .build() on
a meter's observable-instrument builder returns a handle. Dropping the
handle calls unregister() on the pipeline. The next Pipeline::produce()
cycle then re-allocates a new aggregator entry in
Inserter::cached_aggregator's HashMap. Over hundreds of 30-second export
cycles this grows the HashMap without bound — a real, monotonic leak that
heap profilers attribute to Pipeline::produce.
This applies to all observable instruments, not just gauges:
u64_observable_gauge/f64_observable_gauge/i64_observable_gaugeu64_observable_counter/f64_observable_counteri64_observable_up_down_counter/f64_observable_up_down_counter