-
-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable SDK if initialized without a [valid] DSN #2712
Comments
The benefit of this fix is that the running code doesn't pollute the logs. If you pass in a wrong DSN, the SDK should only print one error message that it couldn't parse the DSN, so users don't miss it. |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Description
If the SDK is initialized with out a DSN, or an invalid one, then it will never be able to upload data for use by customers. But, as of today, it will still gather that data by installing its various runtime mechanisms. This incurs a performance cost with no benefit.
We will even state in a log message that the SDK failed to initialize here:
sentry-cocoa/Sources/Sentry/SentryOptions.m
Line 164 in 63f740d
Which isn't quite accurate because methods like
startTransaction
andswizzleInstanceMethod
will still operate, which I wouldn't expect with an uninitialized SDK. For those and other top-level methods, we should check whether the SDK was successfully initialized before proceeding.That log method should also explicitly state that, if not provided a valid DSN, the SDK will do no further work.
The text was updated successfully, but these errors were encountered: