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

RFC: tokio-tracing compatible layer #191

Open
andylokandy opened this issue Jan 25, 2024 · 6 comments
Open

RFC: tokio-tracing compatible layer #191

andylokandy opened this issue Jan 25, 2024 · 6 comments

Comments

@andylokandy
Copy link
Collaborator

andylokandy commented Jan 25, 2024

By adding a tokio-tracing compatible layer to minitrace, we can provide a low-overhead tracing solution for tokio applications, combining the performance benefits of minitrace with the convenience and familiarity of tokio-tracing.

Initial thoughts:

  • Collect spans generated by tokio-tracing, convert and attach to minitrace spans.
  • Reports span generated either by minitrace or tokio-tracing by minitrace.

cc @zhongzc

@andylokandy andylokandy changed the title RFC: tokio-tracing compactible layer RFC: tokio-tracing compatible layer Jan 25, 2024
@andylokandy
Copy link
Collaborator Author

@dotansimha I noticed mix usage of minitrace and tokio-tracing in Conductor, would the compatible layer help?

@dotansimha
Copy link
Contributor

@dotansimha I noticed mix usage of minitrace and tokio-tracing in Conductor, would the compatible layer help?

At the moment we are using tracing only for logging and some performance information. We are not using it to generate trace spans. These logs and performance info are internal to the service at the moment.
We are using minitrace to create spans for things that the user want to ship externally (see https://the-guild.dev/graphql/gateway/docs/plugins/telemetry).

Regarding your question, I don't see a real need at the moment to have a unified setup, as we are using each library for different purposes.
I'm actually considering another alternative: drop tracing and replace it with the log crate.

@zhongzc
Copy link
Collaborator

zhongzc commented Jan 25, 2024

By reversing your initial thought, we might be able to realize performance gains:

minitrace is in charge of span generation, and tokio-tracing collects the spans produced by minitrace.

@andylokandy
Copy link
Collaborator Author

andylokandy commented Jan 25, 2024

Both direction have their use case, but I think it's a fact that only application could include a compat layer, and most libraries are using tokio-tracing, therefore only the direction of tokio-tracing to minitrace is needed in practise.

@zhongzc
Copy link
Collaborator

zhongzc commented Jan 25, 2024

So low-overhead cannot be achieved. Are there any scenarios for this requirement?

@andylokandy
Copy link
Collaborator Author

it's temporary for transition. The ultimate goal will be completly removing the compat layer in the build graph.

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

No branches or pull requests

3 participants