Skip to content

Improve symfony response times when tracing is enabled #465

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

Merged

Conversation

rjd22
Copy link
Contributor

@rjd22 rjd22 commented Mar 13, 2021

Improve symfony response times when tracing is enabled by sending
the tracing results on kernel terminate. Kernel terminate happens
after rendering and sending the response to the client so clients
won't notice any delay.

Fixes: #464

Before change:
Screenshot from 2021-03-13 13-21-59

After change:
Screenshot from 2021-03-13 13-22-37

Copy link
Contributor

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test are failing, but change is good! Thank you for spotting this!

@Jean85 Jean85 linked an issue Mar 15, 2021 that may be closed by this pull request
@rjd22
Copy link
Contributor Author

rjd22 commented Mar 15, 2021

@Jean85 The tests are failing because of some change somewhere else sadly. I checked and have nothing to do with my change.

Most likely related to: #461

@ste93cry
Copy link
Contributor

The tests are failing because of some change somewhere else sadly. I checked and have nothing to do with my change.

Yes, I'm waiting for a patch release from Symfony to update all pending PRs which are all failing to pass the CI

change is good!

This PR should include the changes discussed in the referenced issue. @rjd22 let me know if you want to work on them, being the PR's author 😉

@ste93cry
Copy link
Contributor

ste93cry commented Mar 29, 2021

@rjd22 can you please rebase this PR and let me know if you're willing to work on the rest of the changes 🙏?

@rjd22
Copy link
Contributor Author

rjd22 commented Mar 29, 2021

@ste93cry I will see if I can make some time later this week to revise it and add some spans.

Would kernel.request and kernel.terminate be acceptable names for the spans or do you have another suggestion?

@Jean85 Jean85 added this to the 4.1 milestone Mar 30, 2021
@Jean85
Copy link
Contributor

Jean85 commented Mar 30, 2021

I'll mark this as a bug because I consider this a blocker for releasing the tracing instrumentation: this is not an acceptable performance degradation for the user; thanks for spotting it.

@ste93cry
Copy link
Contributor

Would kernel.request and kernel.terminate be acceptable names for the spans or do you have another suggestion?

Although I don't like it because it isn't really meaningful, I would leave http.server for the first span because I think Laravel and other SDK use it already

@rjd22
Copy link
Contributor Author

rjd22 commented Mar 30, 2021

@ste93cry Then http.terminate for the second one for consistency?

@ste93cry
Copy link
Contributor

Ok, I don't have any better suggestion by the way 😄

@ste93cry
Copy link
Contributor

ste93cry commented Apr 6, 2021

I will see if I can make some time later this week

@rjd22 Since I see no activity here and I would like to release at the beginning of the next week the new version, do you mind if I take care of finishing the work? I'm asking this to avoid both of us working on the same thing without the other knowing 😄

@rjd22
Copy link
Contributor Author

rjd22 commented Apr 6, 2021

@ste93cry I'm extremely sorry that I didn't make time to pick this up as promised. I would be really grateful if you would finish this one up.

Feel free to take it over ❤️

@ste93cry
Copy link
Contributor

ste93cry commented Apr 6, 2021

No problem, I don't feel good at keeping pinging people to finish the work when I'm the first one taking ages to review the PRs and I don't feel good at always taking over the work of other people, but I really wanna push the release out asap, that's all 😃 I will work on this PR in the next days, in the meanwhile thank you for the contribution so far which as always is much appreciated

@ste93cry ste93cry force-pushed the improve-sentry-tracing-response-times branch from 5114595 to 6f46bdd Compare April 8, 2021 21:35
rjd22 and others added 2 commits April 12, 2021 15:40
Improve symfony response times when tracing is enabled by sending
the tracing results on kernel terminate. Kernel terminate happens
after rendering and sending the response to the client so clients
won't notice any delay.
@ste93cry ste93cry force-pushed the improve-sentry-tracing-response-times branch from a37d1ed to 8287218 Compare April 12, 2021 13:41
Copy link
Contributor

@ste93cry ste93cry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking again at the changes I requested, I changed my mind mainly because in the context of a traditional Symfony application the master request is the transaction and lasts for the entire application's lifecycle, so it doesn't really makes sense to represent it as a child span of the transaction. In the future though, we may want to take inspiration from the Symfony profiler to create child spans for certain pieces of the application lifecycle, e.g. the execution of the controller or the sending of the response back to the client

@ste93cry ste93cry merged commit ab8d1d0 into getsentry:develop Apr 12, 2021
@rjd22 rjd22 deleted the improve-sentry-tracing-response-times branch April 12, 2021 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling tracing slows down render to screen
3 participants