Skip to content

Sentry SDK sends events of type session twice to two different DSNs #12569

@karol-szymanowski

Description

@karol-szymanowski

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/nextjs

SDK Version

8.9.2

Framework Version

Next.js 14

Link to Sentry event

No response

SDK Setup

import * as Sentry from "@sentry/nextjs";

Sentry.init({
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
  tracesSampleRate: 1,
  debug: true,
  replaysOnErrorSampleRate: 1.0,
  replaysSessionSampleRate: 0.005,
  integrations: [
    Sentry.replayIntegration({
      maskAllText: false,
      blockAllMedia: false,
    }),
    Sentry.browserTracingIntegration({
      enableInp: true,
    }),
    Sentry.browserProfilingIntegration(),
  ],
  beforeSendTransaction: (transaction) => {
    // Ignore crawlers
    if (transaction.contexts?.device?.family === "Spider") {
      return null;
    }
    return transaction;
  },
});

Steps to Reproduce

  1. Setup sentry with wizard and set DSN that points to the sentry hosted on premise
  2. Open web page and check network/logs

Expected Result

Events are sent only to one Sentry destination

Actual Result

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions