Skip to content

Consider not initialising the Sdk from logging integrations #5245

@jamescrosswell

Description

@jamescrosswell

Description

This and this and this are just three examples in the last two weeks of many many conversations we've had about this issue over the years. It's very confusing to SDK users and even trips us up as maintainers on occasion.

Currently you can initialise Sentry:

  1. Via integrations like our Maui or Asp.Net Core integration that support a certain app type/framework
  2. Via the static SentrySdk.Init
  3. Via one of our logging integrations

The trouble is that the logging integrations are frequently used in conjunction with one of the first two types and then you have to tell the logging integration: Yes do send logs to Sentry, but no do not initialise the Sentry SDK (it's already been initialised).

Initialisation via the logging integrations was added so that if someone is only using the logging integration (e.g. in a Console app) they don't need to call SentrySdk.Init... it saves them a method call at startup.

Given the amount of confusion this causes, I think we should consider changing this so the logging integrations only configure the sink or whatever and the SDK always has to be initialised separately via 1 or 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    Status

    Waiting for: Product Owner

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions