Skip to content
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

Initial implementation of sentry tracing with tests #423

Merged
merged 7 commits into from Mar 3, 2021

Conversation

rjd22
Copy link
Contributor

@rjd22 rjd22 commented Jan 22, 2021

This is my initial experimental implementation of tracing. It is unfinished because it connects quite directly to the dependencies of the project.

How does it look now

I've run it on my personal pet project. Enjoy!

Screenshot from 2021-01-22 16-16-12

@ste93cry ste93cry changed the base branch from master to develop January 22, 2021 17:27
@ste93cry
Copy link
Collaborator

Thank you for the willingness of contributing! May I ask you to split each feature (the request tracing listener, the Twig tracing listener, etc) into its own PR? This way, it will be both easier to review the code and we can develop them independently without necessarily having to rush for the release of all of them at the same time

@rjd22
Copy link
Contributor Author

rjd22 commented Jan 22, 2021

@ste93cry Thank you for your feedback. This is a really good idea. I will split them up later.

@rjd22 rjd22 changed the title WIP: Initial implementation of sentry tracing with twig and doctrine support Initial implementation of sentry tracing with tests Jan 24, 2021
@rjd22 rjd22 force-pushed the feature/tracing-support branch 4 times, most recently from 3c95a85 to 9978c35 Compare January 24, 2021 14:56
phpstan.neon Outdated Show resolved Hide resolved
@rjd22
Copy link
Contributor Author

rjd22 commented Jan 24, 2021

@ste93cry I splitted off the dbal and twig tracing support and added tests. Testing was quite complex and took me too much time. I'm not planning to invest more of my time into this except for small changes.

@stayallive
Copy link
Collaborator

I'll let @ste93cry and @Jean85 actually comment on the code but looking as a non-symfony dev this looks pretty nice already!

I wanted to at least have thanked you for taking the time to get this started, this is a huge help and very much appreciated. I'm sure Stefano and Alessandro will be able to get this in with this head-start, thanks!

@rjd22
Copy link
Contributor Author

rjd22 commented Jan 24, 2021

I also made an PR for dbal tracing:
#426

@rjd22 rjd22 closed this Jan 26, 2021
@rjd22 rjd22 reopened this Jan 26, 2021
@rjd22
Copy link
Contributor Author

rjd22 commented Jan 26, 2021

Closing and reopened to trigger build

@ste93cry
Copy link
Collaborator

Are you willing to rebase this PR so that we can proceed with reviewing it?

@rjd22
Copy link
Contributor Author

rjd22 commented Feb 17, 2021

@ste93cry yep I will do so later.

@rjd22
Copy link
Contributor Author

rjd22 commented Feb 23, 2021

@Jean85 did you mean to merge master into this branch? Since it was based on develop.

@Jean85
Copy link
Collaborator

Jean85 commented Feb 23, 2021

@Jean85 did you mean to merge master into this branch? Since it was based on develop.

Crap, that's what I was doing wrong!
Fixing it, in progress!

@Jean85 Jean85 force-pushed the feature/tracing-support branch 2 times, most recently from 354c4a6 to a4b5fb3 Compare February 23, 2021 12:05
@Jean85
Copy link
Collaborator

Jean85 commented Feb 23, 2021

Ok I force pushed reverting back to a4b5fb3 which was the last commit before my screw up.
I'll attempt to correctly rebase now.

@Jean85
Copy link
Collaborator

Jean85 commented Feb 23, 2021

Nope, the right one was 9978c35, and it correctly didn't have any conflicts 😓 that was messy!

@rjd22
Copy link
Contributor Author

rjd22 commented Feb 23, 2021

@Jean85 @ste93cry Thanks for your work. I've moved the classes to be ordered similar to the other tracing classes. And added the changes to the Changelog. I think this one is good to go. When this is merged I will start testing this on a acceptance environment to test the stability and report back the results :).

@Asesjix
Copy link

Asesjix commented Feb 25, 2021

Here is a good integration from Jaeger.
You could certainly learn something from the integration.
https://github.com/code-tool/jaeger-client-symfony-bridge

Thanks for the integration! I am already waiting for it!

@ste93cry
Copy link
Collaborator

Here is a good integration from Jaeger.
You could certainly learn something from the integration

Thank you. I'm taking inspiration from the Opentelemetry project because I heard about it in the past, but looking at the package you linked it should be on the same wavelength 😃

I've moved the classes to be ordered similar to the other tracing classes.

Thank you for contributing to the project. I had no time to leave a code review before you made more changes, I feel sorry for this, but I moved the classes back to the EventListener directory because I think that since they are listeners it's better to have all of them under one place only. Instead, the other are specific pieces of integration for third parties that are well suited to be organized under a different folder structure.

When this is merged I will start testing this on a acceptance environment to test the stability and report back the results :)

Because as of now I mainly used the tests (both unit and e2e) to simulate requests and console commands to check that at least the basics work, this would be really cool!

@ste93cry ste93cry requested a review from Jean85 February 27, 2021 01:51
src/Resources/config/schema/sentry-1.0.xsd Outdated Show resolved Hide resolved
tests/bootstrap.php Show resolved Hide resolved
composer.json Show resolved Hide resolved
@ste93cry ste93cry requested a review from Jean85 March 2, 2021 17:48
@rjd22
Copy link
Contributor Author

rjd22 commented Mar 2, 2021

Btw @ste93cry I've been checking your improvements on my implementation and wanted to thank you personally for how much better this implementation has become.

Thank you!

@ste93cry
Copy link
Collaborator

ste93cry commented Mar 2, 2021

FYI, I reverted some of your changes, for example the one that was creating a span for the response and the controller, because I'm not sure we need to go so deep at this moment with tracing and because I'm not sure the events you used were as precise as we would expect. Since I didn't want to postpone merging this PR for too much time, we can go back to the table and improve these aspects further in the next iterations

Copy link
Collaborator

@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.

Great work everybody!

@ste93cry ste93cry merged commit 8f7a737 into getsentry:develop Mar 3, 2021
@rjd22 rjd22 deleted the feature/tracing-support branch March 3, 2021 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

trace/performance is not being collected/pushed
5 participants