opentelemetry-python-contrib
opentelemetry-python-contrib copied to clipboard
Pymongo instrumentation: Capturing statements for additional command types
trafficstars
Description
Adds full statement capturing for additional Mongo commands: findAndModify, aggregate, and createIndexes.
https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1512 originally added statement capturing, but only captured statements for a few command types.
findAndModify (aka find_one_and_update in pymongo) has two attributes of interest, so COMMAND_TO_ATTRIBUTE_MAPPING was changed slightly.
Fixes https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1951.
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
How Has This Been Tested?
Added unit tests to test statement capturing for each additional command type.
Does This PR Require a Core Repo Change?
- [ ] Yes. - Link to PR:
- [x] No.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
- [x] Followed the style guidelines of this project
- [x] Changelogs have been updated
- [x] Unit tests have been added
- [ ] Documentation has been updated