Repository navigation
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
- StatusShow more project fieldsNo status
Activity
s1gr1d commentedon Apr 11, 2024
Hi, thanks for reaching out!
Just some follow-up questions on that: Did you change the SDK version before it started to not work anymore? Or was anything else changed in the code?
spacetoha commentedon Apr 11, 2024
Hello Sigrid,
We have upgraded to the latest SDK indeed however rolling it back did not help.
We use 2 types of transactions in the project.
s1gr1d commentedon Apr 15, 2024
I just tested this with Sentry v7 and v8. This will be fixed in an upcoming v8 release (a beta is coming soon), as we tweaked a lot of scope-related code. This PR adds the tests for making sure this keeps working.
Would it be possible for you to upgrade the application to the beta which is coming in the next few days? When it still doesn't work, please reach out to us.
mydea commentedon May 15, 2024
v8 stable is out, where this should be fixed - give it a try! I'll close this, feel free to re-open if you still encounter this on v8.0.0!