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 support to diagnostics_channel to core #2697
Comments
It'd be good to have an official plugin for it. All the critical information should be available for plugins to consume anyway. |
I'd be interested in working on this plugin. What kind of information do you think would be nice to have published? |
Not entirely sure :). Maybe @Qard can help! |
The main thing I'd see APMs wanting to know from fastify is middleware and routing transitions. Having a name for the middleware and method + routing pattern for the routes would be perfect. I'd need to take a closer look to see if there's anything else interesting in there, but that's a good place to start. |
Out that could be implemented is by adding a hook in |
It'd also help to know when a response is sent. Basically, an APM will want to produce a "span" around each middleware or route, so the transitions can be the start of a new span and then the end is either when another transition happens or a response is started. |
A plugin seems a better choice since the information needed is available through hooks. In case of the response sent, we have the My worry is because the hooks need to be called immediately after the event, to get the elapsed time and metrics around it. At this time, I believe that a plugin is enough. |
Base repo created. Tonight, I'll adjust the foundation to create the plugin https://github.com/fastify/fastify-diagnostics-channel. |
@Qard Span API block this PR? Otherwise, how do you think that is better to provide the information? I mean, some basic rules as:
Therefore, we have some best pratices to create a channel name or something like that? |
For now, I would just add transition events and not worry about spans. Spans can be added later, if we eventually decide on an API for that. For comparison, here's the changes I did for express: pillarjs/router#96. It doesn't have spans, just a single event when the transition happens with (hopefully) sufficient metadata to identify the full routing path. (The routing path thing is complicated in express, which is why that hasn't landed yet...I'll get back to it at some point soon, hopefully...) |
PR created: fastify/fastify-diagnostics-channel#3 |
I think this could be closed for now. |
馃殌 Feature Proposal
Hey folks!
The diagnostics_channel was landed on v15 and seems fair to think about to include it on fastify core, since that it will help the APM vendors and self-analysis.
@Qard made nice work there and I mentioned here to help us if needed.
For further information, check the PR here and the changelog here.
The stability on the core is still experimental but seems fair to talk about now.
The text was updated successfully, but these errors were encountered: