-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add tracing support #345
base: master
Are you sure you want to change the base?
Add tracing support #345
Conversation
@kevinmehall I think the PR test is a false positive. Maybe I need you to manually test the new |
One concern I have with this is that right now you don't have to write any code to get the trace output; you just I like the idea of using tracing spans to represent the tree structure -- do you have an example of what that looks like on any of the preexisting subscribers? |
The test failure is real, and it's an issue with doing this -- the calls to tracing are emitted in the crate where the macro is invoked, so it's that crate, not Adding it to dev-dependencies merely works around this issue for the tests because |
Wow! Although it looks insanely long, but the key point is already there! Now we just need to tidy it up give it a unique look. I'm also pretty sure it would look much cooler in Jaeger/Loki |
This PR would also solve #141. Can't believe we dug up a necro-issue... |
I'm not satisfied with this tracing test result. Why wouldn't GH Actions prettify JSON for me... |
This PR will address #344 but there is a catch: for some reason the macro just crash saying that something beyond my control:
I'm not sure but does that looks like we have a memory constraint in procedural macros? I'm not aware of this, but so far the PR just added rule instrumentation and I tried to keep the original intent as much as possible.
Not only instrumentation can let us get rid of another hidden
std
requirement, but that it will produce a nested context -- the level of calling of functions that is very valuable in debugging recursive call by providing a tree-like structure for diagnostic. To print the tracings is now left up to the users, say like either I want to print it directly in stdout, or I could make a super fancy web app that sends the data to a remote server with WebSocket and display it in a canvas that actively traces the input value for replaying (cough Jaeger)! Now I just showed one bizarre usage on how now the tracing's sky would be limitless.But before I can pass the macro bootstrapping test, I would suggest keeping this in draft state.It passed?! So now let me try to demonstrate how tracing would works and be valuable then...