Skip to content

console.trace causing level:error events in Sentry #11829

@jeysal

Description

@jeysal

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.112.2

Framework Version

Next.js 14.1.4

Link to Sentry event

https://playtnet.sentry.io/issues/5259621428

SDK Setup

Printed server-side Sentry config:

{
  dsn:
'https://d66c28aa36164b0f873a60bd0556ac90@o4504684409782272.ingest.sentry.io/4504684413845504',
  environment: 'development',
  integrations: [
    {
      name: 'CaptureConsole',
      setupOnce: [Function: setupOnce],
      setup: [Function: setup]
    },
    {
      name: 'OnUncaughtException',
      setupOnce: [Function: setupOnce],
      setup: [Function: setup]
    },
    {
      name: 'OnUnhandledRejection',
      setupOnce: [Function: setupOnce],
      setup: [Function: setup]
    },
    Mongo {
      name: 'Mongo',
      _operations: [Array],
      _describeOperations: true,
      _useMongoose: false
    },
    Prisma { name: 'Prisma' }
  ],
  tracesSampleRate: 0.02,
  beforeSend: [Function: beforeSend],
  release: '',
  beforeSendTransaction: [Function: beforeSendTransaction]
}

Notably, console capturing is set up with captureConsoleIntegration({ levels: ["warn", "error"] }) and the custom beforeSend* functions do not contain any logic that could set an event.level to 'error'

Steps to Reproduce

Some time around Thu 2024-04-25 console.traces started being captured with level:error.

We did not change our Sentry config, logging infrastructure, or relevant package versions. The Vercel/AWS Lambda Node version may or may not have changed during that time.

It could also be possible that not the logging but the pure act of capturing a stack trace (which console.trace does) is what's entering an event into Sentry?

Expected Result

console.trace calls do not cause an event in Sentry unless the console capturing integration is set up to do so.

Actual Result

console.trace calls cause a level:error event in Sentry (see example link to Sentry event)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions