1
1
---
2
2
title : PyMongo
3
- redirect_from :
4
- - /clients/python/integrations/pymongo/
5
- - /platforms/python/pymongo/
6
3
description : " Learn about using Sentry with PyMongo."
7
4
---
8
5
9
- The Pymongo integration adds support for [ Pymongo] ( https://www.mongodb.com/docs/drivers/pymongo/ ) - the official MongoDB
6
+ The Pymongo integration adds support for [ Pymongo] ( https://www.mongodb.com/docs/drivers/pymongo/ ) , the official MongoDB
10
7
driver. It adds breadcrumbs and performace traces for all queries.
11
8
12
9
## Install
@@ -19,7 +16,7 @@ pip install --upgrade 'sentry-sdk[pymongo]'
19
16
20
17
## Configure
21
18
22
- To configure the SDK, initialize it before creating any PyMongo's MongoClient instances:
19
+ To configure the SDK, initialize it before creating any of PyMongo's MongoClient instances:
23
20
24
21
``` python
25
22
import sentry_sdk
@@ -50,12 +47,12 @@ automatically.
50
47
## Other MongoDB libraries
51
48
52
49
PyMongo is an official synchronous driver for MongoDB. It means that many other Python libraries interacting with
53
- MongoDB use it under the hood, for example ` mongoengine ` (always) or ` umongo ` (if selected from multiple available
50
+ MongoDB use it under the hood, like, for example ` mongoengine ` (always) or ` umongo ` (if selected from multiple available
54
51
drivers). Queries generated by those libraries will also be monitored.
55
52
56
- If a different driver is used ( ` motor ` , ` TxMongo ` ) this integration will not work.
53
+ If you use a different driver (for example, ` motor ` , ` TxMongo ` ), this integration won't work.
57
54
58
55
### Mongomock
59
56
60
- While ` mongomock ` can be used to replace ` PyMongo ` in tests it does not implement all features available in the official
57
+ While ` mongomock ` can be used to replace ` PyMongo ` in tests, it doesn't implement all features available in the official
61
58
driver. This integration will not generate any breadcrumbs or spans from ` mongomock ` 's clients.
0 commit comments