-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
7.109.0
Framework Version
7.109.0
Link to Sentry event
SDK Setup
// You can also use ESM `import * as Sentry from "@sentry/node"` instead of `require`
import * as Sentry from "@sentry/node";
import { nodeProfilingIntegration, } from "@sentry/profiling-node";
import { captureConsoleIntegration } from "@sentry/integrations";
import express from "express";
const app = express();
Sentry.init({
dsn: "DSN",
integrations: [
// enable HTTP calls tracing
new Sentry.Integrations.Http({ tracing: true }),
new Sentry.Integrations.Express({ app }),
// captureConsoleIntegration(),
// enable Express.js middleware tracing
nodeProfilingIntegration()
],
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set sampling rate for profiling - this is relative to tracesSampleRate
profilesSampleRate: 1.0,
});
// The request handler must be the first middleware on the app
app.use(Sentry.Handlers.requestHandler());
// TracingHandler creates a trace for every incoming request
app.use(Sentry.Handlers.tracingHandler());
// All your controllers should live here
app.get("/test-call", function rootHandler(req, res) {
const message = 'This message is not shown as console log';
console.log(message);
Sentry.addBreadcrumb({
message: message,
level: "info",
});
res.send("OK")
});
// The error handler must be registered before any other error middleware and after all controllers
app.use(Sentry.Handlers.errorHandler());
// Optional fallthrough error handler
app.use(function onError(err, req, res, next) {
// The error id is attached to `res.sentry` to be returned
// and optionally displayed to the user for support.
res.statusCode = 500;
res.end(res.sentry + "\n");
});
app.get("/debug-sentry", function mainHandler(req, res) {
throw new Error("My first Sentry error!");
});
app.listen(3000);
Steps to Reproduce
Sentry is not picking up console logs as breadcrumbs on HTTP requests for express integration.
Adding breadcrumbs explicitly does not work either.
Please find the playground project attached.
We recently stopped seeing breadcrumbs for all the HTTP requests.
We were able to reproduce this issue using a minimum viable project.
Expected Result
Console logs are being shown as breadcrumns in the sentry console on express HTTP event
Actual Result
Console logs are not being shown as breadcrumbs in the sentry console on express HTTP event
Metadata
Metadata
Assignees
Labels
Projects
Status
No status