Skip to content

Support for multiple DSNs in Sentry.init() #620

@StreethawkNick

Description

@StreethawkNick

The documentation for the Android configuration doesn't seem to outline how to use multiple DSNs.

    // Use the Sentry DSN (client key) from the Project Settings page on Sentry
    String sentryDsn = "https://publicKey:secretKey@host:port/1?options";
    Sentry.init(sentryDsn, new AndroidSentryClientFactory(ctx));

Diving deeper into the code it shows that storedClient is a static volatile which makes me believe it can't support it.

 public static void setStoredClient(SentryClient client) {
    if (storedClient != null) {
        logger.warn("Overwriting statically stored SentryClient instance {} with {}.", storedClient, client);
    }

    storedClient = client;
}

The reasoning behind wanting multiple DNS is because I'm developing a third party library, so I need Sentry to send events to me, while in the App they also have Sentry to send events to their own.

Is this possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions