[WIP] switch usages of log
to tokio_trace
#7395
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is on top of #7342, and should be merged after that one, if we decide to adopt
tokio-trace
.Problem
tokio-trace
is a tracing framework for asynchronous rust programs (which does not depend on tokio!). The developer gave a talk describing what it is, how it works, and how it can be used: a recording is here. The ability to define spans and events is analogous to distributed tracing systems such as zipkin, which is the subject of #7342. It's possible that adoptingtokio-trace
will make this process easier and more automatic -- for example (shown in the talk), a.instrument()
futures combinator is available viatokio-trace-futures
which will very concisely create a span around the execution of the future!Solution
One of
tokio-trace
's features (viatokio-trace-log
) is being able to be dropped into rust programs usinglog
without too many changes. A demo in the linked talk shows how logs can actually be converted intotokio-trace
events by using a logger which emits these events.This PR drops in
tokio-trace_log::LogTracer
to convert logs into trace events, which at this point are still just emitted as logs.Result
Nothing changes at all, but this enables tracing via
tokio-trace
.TODO
tokio-trace
subscriber.tokio-trace
can effectively integrate with the rest of our existing zipkin tracing (very exciting!).tokio-trace
that provides value overlog
.