Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] switch usages of log to tokio_trace #7395

Closed

Conversation

cosmicexplorer
Copy link
Contributor

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 adopting tokio-trace will make this process easier and more automatic -- for example (shown in the talk), a .instrument() futures combinator is available via tokio-trace-futures which will very concisely create a span around the execution of the future!

Solution

One of tokio-trace's features (via tokio-trace-log) is being able to be dropped into rust programs using log without too many changes. A demo in the linked talk shows how logs can actually be converted into tokio-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

  • Figure out where to put the tokio-trace subscriber.
  • Demonstrate that tokio-trace can effectively integrate with the rest of our existing zipkin tracing (very exciting!).
  • Demonstrate some usage of tokio-trace that provides value over log.

@Eric-Arellano
Copy link
Contributor

Stale?

@Eric-Arellano
Copy link
Contributor

Bump that I suspect this is also stale / can be closed? We've made lots of simplifications to the logging infrastructure recently, such as #10686.

@Eric-Arellano
Copy link
Contributor

Closing as stale. Feel free to reopen if you plan to revive it.

@cosmicexplorer
Copy link
Contributor Author

Yes! That’s appropriate! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants