[HN Gopher] Instrument a Rust Application with OpenTelemetry
___________________________________________________________________
Instrument a Rust Application with OpenTelemetry
Author : neinasaservice
Score : 42 points
Date : 2021-11-23 13:50 UTC (9 hours ago)
(HTM) web link (21-lessons.com)
(TXT) w3m dump (21-lessons.com)
| couchand wrote:
| Something basic that's missing from this tutorial is
| instrumenting Futures. The tracing crate (which I believe can
| export to an OpenTelemetry backend) has tracing-futures for this.
| Is there something similar for the opentelemetry crate? From a
| cursory review of the docs I haven't seen mention of it...
| dochtman wrote:
| There's a tracing-opentelemetry crate that lives in the tracing
| repo that lets you connecting tracing to opentelemetry.
| TrueDuality wrote:
| Yup, tracing-opentelemetry is actually called out on the core
| tracing crate page (https://crates.io/crates/tracing) and it
| works pretty well.
|
| I gave a quick look through the article's samples and I think
| the tracing crate has much better ergonomics. Wrapping a lot of
| code in lambdas to handle spans ends up making a code base
| pretty nasty in my experience.
|
| Being able to simply tag a function for instrumentation (and
| skip/choose which arguments to include), the ability to
| enter/exit spans as one liners rather than wrapping a chunk of
| code in a block, and being able to easily add additional
| attributes/data to those spans without type wrangling are all
| quality of life improvements that I don't want to give up.
|
| The article's crates might be able to do the same things, I
| haven't looked into its documentation.
| couchand wrote:
| Found it!
| https://docs.rs/opentelemetry/0.16.0/opentelemetry/trace/ind...
___________________________________________________________________
(page generated 2021-11-23 23:02 UTC)