Skip to content

initialScope tags are not applied to events captured via Sentry.logger #18506

@programming-with-ia

Description

@programming-with-ia

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. Configure initialScope with global tags in sentry.server.config.ts (or sentry.edge.config.ts):

    Sentry.init({
      dsn: process.env.SENTRY_DSN,
      initialScope: {
        tags: {
          microservice: "web"
        }
      }
    });
  2. In a server-side file (e.g., @eden.server.ts), use the new Sentry.logger interface:

    import * as Sentry from "@sentry/nextjs";
    
    // ... inside a function
    Sentry.logger.info("Testing logger tags");
  3. View the captured log event in the Sentry dashboard.

Expected Result

The event generated by Sentry.logger.info should automatically include the microservice: "web" tag defined in the initialScope, matching the behavior of Sentry.captureException or Sentry.captureMessage.

Actual Result

The event is captured successfully, but the microservice tag is missing from the "Tags" section in the issue details.

Product Area

Explore

Link

No response

DSN

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions