-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: MongoDB Tracing Support #3072
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
Conversation
1ece354
to
d3e56c6
Compare
size-limit report
|
6efe345
to
8926f90
Compare
8926f90
to
17ed7b9
Compare
* Patches original collection methods | ||
*/ | ||
private _instrumentOperations(collection: MongoCollection, operations: Operation[], getCurrentHub: () => Hub): void { | ||
operations.forEach((operation: Operation) => this._patchOperation(collection, operation, getCurrentHub)); |
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.
Why pass in getCurrentHub
?
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.
This is how integrations work internally, the function will be injected from outside and we should use that vs. global getCurrentHub
.
public name: string = Mongo.id; | ||
|
||
private _operations: Operation[]; | ||
private _describeOperations?: boolean | Operation[]; |
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.
Is "describe" your word or theirs? If it's yours, I wonder if we might name this option differently, to a) differentiate it from the description
field in a transaction, and b) indicate that what it's really about is recording the operation's inputs.
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.
I think describe
is used in database lingo.
Merging this now, has also few other fixes. |
Hi, question about MongoDB support. I'm currently using Mongoose inside an Express app and when adding new Tracing.Integrations.Mongo() to integrations array in Sentry.init, I got the following error: UnhandledPromiseRejectionWarning: TypeError: Tracing.Integrations.Mongo is not a constructor Do I have to pass some config or it just doesn't support Mongoose right now? |
I can't seem to get this working with Mongoose. I've added Tracing.Integrations.Mongo() to the integrations array without receiving an error message but it doesn't seem to be tracking database requests at all. Has anyone successfully got this working with Mongoose yet? |
Same here, would love to see mongoose support for this. |
MongoDB tracing support.
Usage:
Works nicely with Express too: