Feature Request:
Would it be possible to integrate XRay Tracing like that: https://github.com/mixmaxhq/mongo-aws-xray
???
Regards
What does this x-ray tracing thing do? The docs don't really have any meaningful examples right now
XRay is a tracing capability for AWS which can then trace any user request from the browser until the result of the database in some kind of service map automatically. See: https://aws.amazon.com/xray/?nc1=h_ls
This may be possible using mongoose middleware, e.g., pre and post hooks.
In theory, it should be possible by overriding $wrapCallback, but in my observation this is not capturing the entire operation.
See https://github.com/mongoosejs/mongoose-async-hooks/issues/8
This would actually be sufficient, is there an empty plugin template somehow, then I can test it...?
This would be super neat, it would save us having to implement something manually.
Hey all, I've created the following plugin. Be good to have somebody take a look and give any feedback you may have. The main issue I see is properly correlating the pre and post middleware, especially on insertMany since "this" is the actual model.
https://www.npmjs.com/package/mongoose-xray
@eric-swann-q2 I took a quick look and this plugin is very well written :+1: I like how you split up middleware by the 4 types: document, aggregation, query, model.
@vkarpov15 Thanks for your feedback!
@eric-swann-q2 you rock bro! going to try it now!!!! Thanks, will probably give feedback to or even suggest more changes as hour mongoose thing is not very common.
@eric-swann-q2 awesome work on the mongoose-xray package. I just created a PR to include Service Map support. Happy to discuss the changes directly on the PR https://github.com/unbill/mongoose-xray/pull/5
Oh nice thanks @jmattiace, I'll take a look.
@jmattiace I've merged in the PR, thanks for the addition!
Most helpful comment
Hey all, I've created the following plugin. Be good to have somebody take a look and give any feedback you may have. The main issue I see is properly correlating the pre and post middleware, especially on insertMany since "this" is the actual model.
https://www.npmjs.com/package/mongoose-xray