Closed zmitchell closed 1 year ago
it's necessary to comment out the #![cfg_attr(not(test), deny(unused))] line
Fortunately this has been fixed upstream https://github.com/taiki-e/pin-project/blob/main/CHANGELOG.md#1011---2022-07-02
Including a bump to pin_project 1.0.11 should fix this
This looks super useful. From your example it looks like yup_oauth uses tracing spans too? I know tower already does, this is nice interop
Yeah, a lot of the async ecosystem uses tracing
since otherwise it's really hard to know the order of operations and what's getting run when.
I had to bump the MSRV (1.57.0 -> 1.59.0) in order to get this to compile.
Btw, I learned that you can filter the logs to particular crates and particular levels like this:
$ RUST_LOG=ya_gcp=info,h2=info
That's pretty handy when you want to shut h2
up but see logs/spans from other crates, h2
is pretty chatty.
Btw, I can merge this without a review, so we should adjust whatever setting that is to require reviews.
This PR adds
tracing
spans to publish/subscribe paths as well as a fewdebug!
events for good measure to aid in debugging. It also addstracing_subscriber
to thepubsub_stream
example to visualize the spans and events that were added. With the currentclippy
settings it's necessary to comment out the#![cfg_attr(not(test), deny(unused))]
line inlib.rs
in order to compile the tests (it complains about theproject_ref
method on somepin_project
structs), but that's unrelated to this PR.The output when viewed with
tracing_tree
contains logs that look like this:and this
Note that the multiple
sink_flush
spans come from the fact that our flushing logic is recursive.