Repository navigation
Closed
Labels
Description
Environment
SaaS (https://sentry.io/)
What are you trying to accomplish?
I've added in the appropriate database integrations to see db queries in my transactions:
https://docs.sentry.io/platforms/node/performance/database/
How are you getting stuck?
Database queries are not being detected and showing up for some transactions.
Sentry initialization:
import * as Sentry from "@sentry/node";
import {ProfilingIntegration} from "@sentry/profiling-node";
import {sentryAddMetrics} from "@/middleware/sentryAddMetrics";
export function initSentry(app): void {
const isProd = process.env.REACT_APP_ENVIRONMENT === "production";
Sentry.init({
dsn: "...",
environment: process.env.REACT_APP_ENVIRONMENT,
integrations: [
new ProfilingIntegration(),
new Sentry.Integrations.Express({
// to trace all requests to the default router
app
}),
new Sentry.Integrations.Mongo({
useMongoose: true
}),
new Sentry.Integrations.Http({tracing: true})
],
beforeSend: (event, hint) => {
const error: any = hint.originalException;
if (error && (
(error.status && error.status < 500) ||
(error.httpStatus && error.httpStatus < 500)
)) {
return null
}
return event;
},
// Performance Monitoring
tracesSampleRate: isProd ? 0.1 : 1.0,
// Set sampling rate for profiling - this is relative to tracesSampleRate
profilesSampleRate: 1.0,
});
app.use(Sentry.Handlers.requestHandler())
app.use(Sentry.Handlers.tracingHandler())
app.use(sentryAddMetrics);
}
Where in the product are you?
Performance
Link
No response
DSN
https://524f54dda82743f3445b4f28533ef38d@o4505830066159616.ingest.sentry.io/4505869944881152
Version
No response
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
- StatusShow more project fieldsNo status


Activity
getsantry commentedon Apr 8, 2024
Assigning to @getsentry/support for routing ⏲️
[-]Node SDK: setMeasurement not adding metrics to POST/PUT transactions[/-][+]Node SDK: Some transactions are not showing db queries[/+]Lms24 commentedon Apr 10, 2024
Hey @jennyunh thanks for writing in!
Can you provide some further information about this behaviour:
We're currently working on the next SDK major version (v8) which should increase the quality of our express and DB integration spans because we're using OpentTelemetry instrumentation. Currently, we're still in an alpha state but we're targetting a beta in the next days. Might be worth checking out to see if this behaviour resolved itself.
jennyunh commentedon Apr 10, 2024
Hi, thank you for your response.
To address your points:
I am using:
"@sentry/node": "^7.109.0",
"@sentry/profiling-node": "^1.3.5"
A Sentry event that should contain db spans but doesn't:
Event id: 4c43068ccb864d8c967645b310452075
Appreciate the heads-up on the next version and upcoming beta.
29 remaining items
mydea commentedon May 21, 2024
Feel free to open a separate issue, does not hurt to track this here as well - thank you!
AbhiPrasad commentedon Aug 2, 2024
As an update - @onurtemizkan opened a PR for this here: open-telemetry/opentelemetry-js-contrib#2353
we are waiting on reviews.
AbhiPrasad commentedon Aug 14, 2024
open-telemetry/opentelemetry-js-contrib@770130a
Once we update the dep, we need to update the docs for supported versions.
feat(node): Update OpenTelemetry packages to instrumentation v0.53.0 (#…
AbhiPrasad commentedon Sep 9, 2024
This has been released with https://github.com/getsentry/sentry-javascript/releases/tag/8.29.0, the sdk now supports mongoose v8!
SteffenLanger commentedon Sep 12, 2024
Unfortunately, I'm still seeing this error with Sentry
8.30.0. I created a new issue with a GitHub repo to reproduce the issue.kaspesi commentedon Dec 6, 2024
Also still seeing this issue.