-
Notifications
You must be signed in to change notification settings - Fork 64
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tracing integration #79
Conversation
oh interesting contribution, thank you! there is also @aclysma 's not fully sure myself what would be the best setup and recommendation here, and also is a possibility that they both can co-exist with tracing support so users can pick the one they prefer (though ideally with some good docs/comparisons). internally we have our own layer also across puffin & superluminal, and been considering adding tracing to that also, but would likely do it directly in that layer rather than through a separate crate mechanism. think we have to discuss a bit internally and here in the PR of how to best proceed. |
The main use case for me and @mvlabat is to use puffin in combination with bevy. Using |
I think it may be worth considering bevy-specific macros that resolve to whatever you end up wanting to use. That way if you change your mind later on what crate to use, you can change it in one place. (i.e. (I would consider adding this abstraction even if you continue to just use tracing. It's very typical for game engines to define their own wrappers over something like this. And it ensures consumers of your engine who use your macros will get seamlessly transitioned as well any time the engine itself makes a transition.) |
Thank you for the responses!
As @IceSentry noted, we are looking into adding
I agree, this sounds like a good idea. |
Is there any progress on this issue, as it seems ready to merge? |
We had a brief internal discussion I forgot to communicate here. We decided against merging this and recommend people to use |
Alright, thanks for the quick reply. So if using tracing and profiling mean this: #[profiling::function]
#[tracing::instrument]
fn example () {
...
} |
Or an altogether macro which does both, or calls puffin, or nothing depending on features |
I'm not to familiar with |
Checklist
Description of Changes
This adds a new crate implementing integration with
tracing
. This will let puffin users benefit from other libraries that generate spans with thetracing
crate, which I believe is quite extensively used in the Rust ecosystem.I was initially going to publish it to a separate repository, but I thought it would probably be a better addition to this one, to make sure this integration is always up to date, advertise it as an official one if you see it fit here.. and pass the maintenance burden to you guys. 馃槃
I wrote up the documentation a bit hastily, I'm not sure how sufficient it is. So I'm open to suggestions (and I left the edits allowed as well).
And thank you for such an awesome tool. I'm also looking forward to it being used by Bevy, which also relies on
tracing
- so hopefullytracing
support inpuffin
will make Bevy integration much closer to becoming real.