-
Notifications
You must be signed in to change notification settings - Fork 515
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
feat(pymongo): add PyMongo integration #1590
Conversation
BTW I really hope spans like |
Docs PR: getsentry/sentry-docs#5469 |
Hey @Agalin and @polina-popova ! Could you maybe rebase your branch again on the newest master, so everything is up to date? Thanks! |
Awesome. Rebased to master (clean rebase as the only existing file is tox.ini) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey!
Extraordinary work!
Just one change to make sure the personal data of users is save and one change to make it easier for Sentry to identify performance problems with queries.
Oh, and please fix also the linting errors. Thanks! |
I have now added a new function for nicer PII stripping, could you review my PR @Agalin : operasoftware#1 |
I have to stay home to take care of my daughter today (some childrens sickness) Could you fix the tests please @Agalin ? I think when the tests are green we are ready to merge. |
@antonpirker tests now pass in tox on my machine (tested 2.7 with pymongo 3.1 and 3.8 with 4.2). |
Amazing @Agalin ! Thank you so much again for your great work! |
Hey @Agalin if you now rebase on the new master again, it will be merged automatically (after running the tests once again) |
Adds breadcrumbs and performance traces for PyMongo queries using an official monitoring API. Integration is similar to the one available in OpenTelemetry, tags set to values recommended for attributes by OT as specified in `Span Operations` guidelines. PyMongo version selection explanation: * 3.1 - introduction of monitoring API. Only Python 2.7 and 3.6 supported. * 3.12 - latest 3.x release, support for 2.7, 3.6-3.9 (3.7-3.9 added in various minor releases between 3.1 and 3.12). * 4.0 - no support for 2.7, added support for 3.10. * 4.1 - no support for 3.6.0-3.6.1. * 4.2 - no support for any 3.6.
Head branch was pushed to by a user without write access
Ah. My rebase stopped automerge. 😓 @antonpirker can you reapprove? |
Done! (now for the documentation) |
Hey everyone! This will be released today! Again: thank you so much for your contribution, it is really great work! |
Yay, it's happening! |
Adds breadcrumbs and performance traces for PyMongo queries using an
official monitoring API. Integration is similar to the one available in
OpenTelemetry, tags set to values recommended for attributes by OT as
specified in
Span Operations
guidelines.PyMongo version selection explanation:
supported.
various minor releases between 3.1 and 3.12).
Uses
MockupDB
for tests (Python implementation of MongoDB protocol server).mongomock
is a reimplementation of theMongoClient
and doesn't support tracing. This way we get real world like results. Note that pymongo has changed queries sent for some requests between 3.1 and 3.12 (probably 3.7 or 3.11) so additional responder is necessary to handle tests with 3.1.There is no support for GridFS nor server connect/disconnect events. Those can be added in the future although I don't think there is an API similar to
pymongo.monitoring
for GridFS (so monkeypatching would be necessary in this one).closes #1585