sentry-dart icon indicating copy to clipboard operation
sentry-dart copied to clipboard

Use spotlight without supplying a DSN

Open ueman opened this issue 1 year ago • 7 comments

Problem Statement

I want to be able to use spotlight without having to add a DSN.

Solution Brainstorm

Don't throw when spotlight is enabled, but no DSN is configured.

I have no clue whether this is an intended use case, but it would be nice if it's possible.

Are you willing to submit a PR?

Yes

### 🛑 Blocked by
- [ ] https://github.com/getsentry/sentry-cocoa/issues/4620
- [ ] https://github.com/getsentry/sentry-java/issues/3981

ueman avatar Aug 05 '24 08:08 ueman

Yeah sounds good, afaik other sdks do it as well

e.g https://github.com/getsentry/sentry-ruby/issues/2226 and same feature request on .net https://github.com/getsentry/sentry-dotnet/issues/3481

buenaflor avatar Aug 05 '24 12:08 buenaflor

From the Dart SDK perspective it's pretty much just a change in the init assertion, would there be more needed on the native SDKs to make it possible?

ueman avatar Aug 05 '24 13:08 ueman

would there be more needed on the native SDKs to make it possible?

probably the same, I don't think the native sdks currently allow using spotlight without dsn as well.

buenaflor avatar Aug 05 '24 15:08 buenaflor

Blocked by https://github.com/getsentry/sentry-dart/issues/2282 <- I want this issue done first

buenaflor avatar Sep 11 '24 12:09 buenaflor

would there be more needed on the native SDKs to make it possible?

probably the same, I don't think the native sdks currently allow using spotlight without dsn as well.

@buenaflor It looks like the Android SDK needs a dsn: sentry.java

    if (!options.isEnabled() || (dsn != null && dsn.isEmpty())) {
      close();
      return false;
    } else if (dsn == null) {
      throw new IllegalArgumentException(
          "DSN is required. Use empty string or set enabled to false in SentryOptions to disable SDK.");
    }

martinhaintz avatar Sep 17 '24 15:09 martinhaintz

@buenaflor I think this is unblocked as #2282 has been fixed with https://github.com/getsentry/sentry-dart/pull/2285

kahest avatar Nov 05 '24 14:11 kahest

@kahest this is not fully unblocked yet because the cocoa and android sdk doesn't support this feature yet (we use the native sdk spotlight option there)

I'll open an issue for that in the cocoa and android repo

buenaflor avatar Nov 06 '24 09:11 buenaflor