-
Notifications
You must be signed in to change notification settings - Fork 1
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
Tokio console #1
Comments
Libraries for TUI:tui-rsBackends:
CursiveBackends:
Thoughts on backendsThere is no silver bullet: Either platform/feature support is missing, or requires installing external libraries. Though that choice could just be exposed and left to the user via feature flags. In that case, care has to be taken to make the UI usable with keyboard support, with mouse support being optional.
|
@MSleepyPanda Thanks for the incredible survey 👍 Just looking at |
I'm working through the issues and PR's labeled with I think it makes sense to categorize scenarios into the following groups:
Also, documentation is really important here! Tools are nothing if they cannot be found or understood.
|
@hawkw Maybe you have thoughts on what the quickest way to get up to speed on
Unfortunately, I have not personally kept track of these bugs. I can try to describe some scenarios. Returning
|
Re: I also noticed that |
It'd be really cool if Tokio's tracing infrastructure also provided USDT ("Userland Statically Defined Tracing") trace points, which allow you to hook into powerful existing tracing and profiling tools like eBPF. When a program contains USDT points, it can be easily instrumented using a tool like There has been some effort (rust-lang/rfcs#875) to get USDTs into the Rust compiler directly, but for the time being it looks like |
@jonhoo I definitely agree that it would be great to get USDT integration in |
@hawkw probably not, but @carllerche asked me to, so I did :p |
Getting ideas out is good. There may be more than one student interested too. |
@carllerche oh, for sure! I just thought tokio-trace/USDT integration just seems something that deserves its own separate project? |
Here is a hang report: tokio-rs/tokio#965 |
I have two comments:
Maybe we could think of some abstraction that allows the user to specify how to handle the data. A default implementation from Tokio could be GRPC.
I am the owner of crossterm, currently, there is a PR of mouse and more key input support. This will be finished any time soon. |
@TimonPost Tokio-console is a layer on top of Tokio-Trace. Tokio-trace is decoupled from any subscription / export format. So, anyone can implement a Tokio-Trace subscriber that exports to influxdb. The Tokio-console project is to implement a subscriber that exports via grpc. I don’t think that it would make much sense to abstract it more. |
The data used by the tokio console will be generated by You're certainly correct that gRPC should definitely not be the only exposition format available for Edit: looks like Carl beat me to it... :) |
@TimonPost Oh, I realised I should also add that if you're interested in writing I'd really like for there to be more subscriber crates available, and I'm happy to provide guidance and advice on how to write one (especially since there aren't yet a lot of existing implementations to base a new one on). |
@carllerche @hawkw alright, thanks for clarifying, must have understood the goal of this task wrong. If GRPC is only used for a console logging then I think it is great. I was going to investigate into the mio-windows issue for GSOC, however, I could take a look into Tokio trace AMQP too, unfortunately, the time I have is a bit low now, lot's of cool projects I have to do some work for already :), I'll let you know when I have a little more time to investigate into that, seems fun to do, thanks again. |
@TimonPost The AMQP subscriber is not particularly urgent; I just thought I'd mention it in case it was something you wanted to see right away. So it definitely doesn't have to be your top priority. Let me know if or when you are interested in hacking on something like that, though, and I'd be happy to help you get started! |
Quick update: Exams are currently eating up my time, but next week i'll dig into implementing a toy subscriber logging to console. Next step will be moving logging to a simple tui (probably tui-rs), but within the same process. This will give a good overview of the requirements, interactions and scope of the project. |
Update I've implemented a demo-ish subscriber and verified that i'm getting the equivalent output by running it side by side with Organization Tokios minimum supported rust version is Naming |
Nice! Let me know if you need any feedback on your code --- I'm happy to take a look.
I think we'll probably want to make a new repo, maybe
We will definitely want the subscriber implementation to be compliant with the minimum version policy if possible, since it would be included in user code as a dependency. However, I think this is less important for the console UI application, since it can just be distributed as a binary. Perhaps @carllerche has a different opinion, though. |
@hawkw Feedback would be nice! I've opened a pull request at my repository for a review. Organization wise, would this count as a patch for the application? |
@MSleepyPanda, crossterm input handling is almost finished. And is probably released this or next week. Here is the tracking issue EDITCrossterm does support input handling in and is available in 0.8.0. |
Thought experiment: What if we wanted to instrument a subscriber implementation with The proposed design would result in a very thin subscriber anyway, since that would probably just pipe through calls, e.g. to
(*): Log compability is optional via feature flag, but since cargo features simply stack up, just one dependency declaring the compatibility feature suffices to enable it for everyone.
Are mitigation strategies possible?
I don't see an easy solution here and i sincerely hope that i'm just missing something here. |
@MSleepyPanda that's definitely a reasonable concern, but I think there's another way around it that you're missing: We would probably want the thread that actually runs the grpc server to be outside of the subscriber context entirely (so we wouldn't wrap it in a Alternatively, if we need to run the |
@hawkw Oh i have missed that one could spawn a thread outside of the subscriber context. I was still thinking in terms of the log implementation, where the |
@MSleepyPanda yeah, unlike |
@MSleepyPanda actually, now that I give it a little more thought, we don't even need to run the gRPC server on a dedicated thread --- we can run it on the same executor as everything else, if we use the We could even use a different subscriber (such as |
In general, we almost certainly do not want subscribers instrumented w/ tokio-trace to dispatch events to themselves. @hawkw This brings up a good point. When calling a subscriber, the dispatcher probably wants to remove itself from the thread-local variable. |
As Kanishkar has expressed interest in this topic as well, we should make sure to split the topics sensibly. I'd propose splitting the project into these subtopic:
Kanishkar has expressed that he would like to work on the subscriber part (topic This would enable us to work isolated for our core topics, while cooperating and interacting on topic I'd love to hear some feedback on this @hawkw, @kanishkarj! |
This seems great! Part 2 didn't click me, well it's great that you pointed it out. Yeah, I guess I could work on the subscriber part. I shall try to understand how a subscriber works so as to define the protobuf schema as soon as possible so that we could work independently. |
The proposed breakdown is good. Please make sure to submit your proposals via the google summer of code UI by April 9th 👍 |
@carllerche yeah definitely :) |
Tokio provides an instrumentation API using Tokio Trace as well as a number of
instrumentation points built into Tokio itself as well as the Tokio ecosystem.
The goal of the project is to implement a subscriber to these instrumentation
points that exports the data out of the process via a gRPC endpoint. Then,
implement a console based UI that connects to the process and allows the user to
visualize the data.
Expected outcomes
Skills
Difficulty level
Medium
The text was updated successfully, but these errors were encountered: