Open CobaltCause opened 4 months ago
Thanks for reporting! It looks like a bug in view implementation, not just an issue with doc. We won't be fixing the View bug, as Views are about to be removed for the initial stable release.
For customizing histogram buckets, https://github.com/open-telemetry/opentelemetry-rust/issues/1241 will be offered instead.
What happened?
The way these variable names are worded make it sound like that's the only effect each view has and neglects to mention that the implementation of these closures also drops all pieces of information about each instrument that aren't specified again via
Stream
combinators. To demonstrate:It's quite surprising that the names are dropped despite no indication that this would happen.
Here's a small program that demonstrates how this is problematic and also demonstrates how to achieve the desired (and implied) behavior:
I've pasted the output of this program in the "Relevant log output" section.
API Version
0.23.0
SDK Version
0.23.0
What Exporter(s) are you seeing the problem on?
Prometheus
Relevant log output