Title: Mongoose tracing plugin instrumentation does not trace useful timings · Issue #4078 · getsentry/sentry-javascript · GitHub
Open Graph Title: Mongoose tracing plugin instrumentation does not trace useful timings · Issue #4078 · getsentry/sentry-javascript
X Title: Mongoose tracing plugin instrumentation does not trace useful timings · Issue #4078 · getsentry/sentry-javascript
Description: Package + Version @sentry/tracing: 6.13.3 Version: 6.13.3 Description Using the mongoose tracing plugin does not produce useful data because it seems to patch functions like .find() which are usually chained: Calls usually look like: con...
Open Graph Description: Package + Version @sentry/tracing: 6.13.3 Version: 6.13.3 Description Using the mongoose tracing plugin does not produce useful data because it seems to patch functions like .find() which are usual...
X Description: Package + Version @sentry/tracing: 6.13.3 Version: 6.13.3 Description Using the mongoose tracing plugin does not produce useful data because it seems to patch functions like .find() which are usual...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4078
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mongoose tracing plugin instrumentation does not trace useful timings","articleBody":"## Package + Version\r\n\r\n- [x] `@sentry/tracing`: 6.13.3\r\n\r\n### Version:\r\n\r\n```\r\n6.13.3\r\n```\r\n\r\n## Description\r\n\r\nUsing the mongoose tracing plugin does not produce useful data because it seems to patch functions like `.find()` which are usually chained:\r\n\r\nCalls usually look like:\r\n\r\n```ts\r\n const results = await model.find({\r\n ...query\r\n })\r\n .sort({ scheduledDate: 1 })\r\n .lean();\r\n```\r\n\r\nHowever, the plugin attaches to the `find` method which returns immediately. Proof of this here:\r\n\r\n\u003cimg width=\"590\" alt=\"Screenshot 2021-10-19 at 15 41 43\" src=\"https://user-images.githubusercontent.com/697707/137911316-78ad3e69-437b-4a95-85ae-14aa459b9ee8.png\">\r\n\r\nInstead of attaching to `find`, it should attach to `exec`.\r\n\r\nReference for properly instrumenting mongoose: https://github.com/aspecto-io/opentelemetry-ext-js/blob/master/packages/instrumentation-mongoose/src/mongoose.ts\r\n\r\nOriginally implemented in: \r\nhttps://github.com/getsentry/sentry-javascript/pull/3252\r\nhttps://github.com/getsentry/sentry-javascript/issues/3176","author":{"url":"https://github.com/andreialecu","@type":"Person","name":"andreialecu"},"datePublished":"2021-10-19T12:44:03Z","url":"https://github.com/getsentry/sentry-javascript/issues/4078"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aa515781-9c23-6f8b-bab9-3062eb89c0e5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C87C:36E50:536237:6FA716:6B04C15D |
| html-safe-nonce | a4034504e90846a122e416a9b8ed460dc4134351ed0daf34546df0955debe6f7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODdDOjM2RTUwOjUzNjIzNzo2RkE3MTY6NkIwNEMxNUQiLCJ2aXNpdG9yX2lkIjoiOTU2MDc4OTgwNTE4NDI5MDIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5a8f3bdb45c11ba853217145492516763831ae37c36825a87b10ed0f65f652df |
| hovercard-subject-tag | issue:1030261771 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/4078/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cea5372a564b95a5fc504253a8536caa49bd17451876fa5b3a397e69064540ef/getsentry/sentry-javascript/issues/4078 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cea5372a564b95a5fc504253a8536caa49bd17451876fa5b3a397e69064540ef/getsentry/sentry-javascript/issues/4078 |
| og:image:alt | Package + Version @sentry/tracing: 6.13.3 Version: 6.13.3 Description Using the mongoose tracing plugin does not produce useful data because it seems to patch functions like .find() which are usual... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andreialecu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width