You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure how widespread this is, but if you try to debug print a prometheus sync instrument it leads to a stack overflow. Or if you debug print with {:#?} it effectively deadlocks trying to print an infinite string, I suspect you would get a stack overflow eventually if you left it for long enough.
The code snippet below demonstrates this problem, it overflows the stack
let exporter = opentelemetry_prometheus::exporter()
.with_resource(Resource::new(vec![KeyValue::new("R", "V")]))
.init();
let provider = exporter.provider().unwrap();
let meter = provider.meter("foo", None);
let counter = meter.f64_counter("test").init();
counter.add(23., &[KeyValue::new("foo", "bar")]);
println!("{:?}", counter);
The text was updated successfully, but these errors were encountered:
Looks like the reason is Instrument refers to Accumulator, which contains references to AsyncInstrument. And AsyncInstrument also contains a reference to Instrument, creating a loop.
TommyCpp
added a commit
to TommyCpp/opentelemetry-rust
that referenced
this issue
May 18, 2021
fixesopen-telemetry#550. We choose to break the loop at instrument level because debug info on `Accumulator` can be found via other structs and descriptors seem to be more important for instruments.
I'm not sure how widespread this is, but if you try to debug print a prometheus sync instrument it leads to a stack overflow. Or if you debug print with
{:#?}
it effectively deadlocks trying to print an infinite string, I suspect you would get a stack overflow eventually if you left it for long enough.The code snippet below demonstrates this problem, it overflows the stack
The text was updated successfully, but these errors were encountered: