otel-rust-observable-handles

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_gauge
  • u64_observable_counter / f64_observable_counter
  • i64_observable_up_down_counter / f64_observable_up_down_counter
Installs
1
Repository
avbel/ai-skills
GitHub Stars
2
First Seen
May 16, 2026