getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
598 stars 207 forks source link

Feature request: MongoDB client instrumentation #2578

Open jessetan opened 1 year ago

jessetan commented 1 year ago

Problem Statement

While Sentry provides low-effort instrumentation of HTTP Client and SQLClient, this does not exist for MongoDB client. It would be really useful if there was an easy way for developers to get more insight into transaction performance of MongoDB using Sentry.

In the recent release 3.36.0 instrumentation of GraphQL queries was added (#2538). The original feature request ticket #2449 makes a case to support at least the most popular GraphQL library based on number of installs. If we compare this with the installation of the MongoDB.Driver package, we can see that MongoDB.Driver is used about 6 times as much, which makes a case for supporting MongoDB.

MongoDB.Driver vs GraphQL installations

Ofcourse it is not realistic to expect Sentry to have built-in support for all possible third-party packages on Nuget, but growing this support to include popular choices like MongoDB, Redis, S3 etc. would make Sentry even more attractive.

References

See also:

bitsandfoxes commented 1 year ago

That's a great feature request, thanks for reaching out! I'll bring that up for the next planning.

jamescrosswell commented 1 year ago

A rudimentary integration is possible using OpenTelemetry. See the https://github.com/getsentry/sentry-dotnet/pull/2634 pull request.

It might be possible to improve this further by implementing some custom enrichers in Sentry.

bruno-garcia commented 1 week ago

Lets do this!

https://sentry.io/changelog/mongodb-is-now-supported-by-queries/ https://x.com/ethansteininger/status/1853878751555113116?s=46&t=PP1rx-wam39ljTQ5uqe7Dg https://develop.sentry.dev/sdk/telemetry/traces/modules/queries/