Skip to content
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

Feature: XRay Tracing #8199

Open
WiesBen opened this issue Sep 26, 2019 · 14 comments
Open

Feature: XRay Tracing #8199

WiesBen opened this issue Sep 26, 2019 · 14 comments
Labels
discussion If you have any thoughts or comments on this issue, please share them!

Comments

@WiesBen
Copy link

WiesBen commented Sep 26, 2019

Feature Request:

Would it be possible to integrate XRay Tracing like that: https://github.com/mixmaxhq/mongo-aws-xray

???

Regards

@vkarpov15
Copy link
Collaborator

What does this x-ray tracing thing do? The docs don't really have any meaningful examples right now

@vkarpov15 vkarpov15 added the discussion If you have any thoughts or comments on this issue, please share them! label Sep 30, 2019
@WiesBen
Copy link
Author

WiesBen commented Oct 2, 2019

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

@joebowbeer
Copy link
Contributor

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 mongoosejs/mongoose-async-hooks#8

@joebowbeer
Copy link
Contributor

@WiesBen
Copy link
Author

WiesBen commented Oct 4, 2019

This would actually be sufficient, is there an empty plugin template somehow, then I can test it...?

@vkarpov15 vkarpov15 added this to the 5.x Unprioritized milestone Oct 7, 2019
@Niffy
Copy link

Niffy commented Feb 7, 2020

This would be super neat, it would save us having to implement something manually.

@eric-swann-q2
Copy link

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

@vkarpov15
Copy link
Collaborator

@eric-swann-q2 I took a quick look and this plugin is very well written 👍 I like how you split up middleware by the 4 types: document, aggregation, query, model.

@eric-swann-q2
Copy link

@vkarpov15 Thanks for your feedback!

@elribonazo
Copy link

@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.

@jmattiace
Copy link

@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 unbill/mongoose-xray#5

@eric-swann-q2
Copy link

Oh nice thanks @jmattiace, I'll take a look.

@eric-swann-q2
Copy link

@jmattiace I've merged in the PR, thanks for the addition!

@joebowbeer
Copy link
Contributor

If this tracing RFE moves forward, I suggest adding hooks for OpenTelemetry tracing, which is compatible with a number of different consumers, including XRay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion If you have any thoughts or comments on this issue, please share them!
Projects
None yet
Development

No branches or pull requests

7 participants