-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Feature: TypescriptPackage: nodeIssues related to the Sentry Node SDKIssues related to the Sentry Node SDK
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser -
@sentry/node -
raven-js -
raven-node(raven for node) - other:
Version:
6.7.1
Description
It started after update from 6.6.0 to 6.7.1. I get error TypeError: samplingCtx.request.query_string.includes is not a function when trying to use SamplingContext.request.query_string as string. This is the code to reproduce the issue:
import * as Sentry from '@sentry/node';
import * as Tracing from '@sentry/tracing';
import express from 'express';
const app = express();
Sentry.init({
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Tracing.Integrations.Express({
app,
}),
],
tracesSampler: (samplingCtx) => {
console.log(samplingCtx.request?.query_string); // prints object { some_param: '1' }
// typehint says it's still string
if (samplingCtx.request?.query_string?.includes("some_param=1")) {
return 1.0;
}
return 0;
},
});
app.use(Sentry.Handlers.requestHandler() as express.RequestHandler);
app.use(Sentry.Handlers.tracingHandler());
app.get('/healthz', (_: express.Request, res: express.Response) => {
return res.json({ok: 1});
});
I guess it's related to this commit f546d0f
and this is the type of query_string from SamplingContext
| query_string?: string; |
Metadata
Metadata
Assignees
Labels
Feature: TypescriptPackage: nodeIssues related to the Sentry Node SDKIssues related to the Sentry Node SDK