-
Notifications
You must be signed in to change notification settings - Fork 590
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
Sentry Filtering #1138
Sentry Filtering #1138
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.homeassistant.companion.android | ||
|
||
import android.content.Context | ||
import io.sentry.android.core.SentryAndroid | ||
import java.net.ConnectException | ||
import java.net.SocketTimeoutException | ||
import java.net.UnknownHostException | ||
import javax.net.ssl.SSLException | ||
import javax.net.ssl.SSLHandshakeException | ||
import javax.net.ssl.SSLProtocolException | ||
|
||
fun initCrashReporting(context: Context) { | ||
// Don't init on debug builds | ||
if (BuildConfig.DEBUG) | ||
return | ||
|
||
SentryAndroid.init(context) { options -> | ||
options.isEnableSessionTracking = true | ||
options.isEnableNdk = false | ||
options.dsn = "https://2d646f40f9574e0b9579e301a69bb030@o427061.ingest.sentry.io/5372876" | ||
options.setBeforeSend { event, hint -> | ||
return@setBeforeSend when (hint) { | ||
is ConnectException, | ||
is SocketTimeoutException, | ||
is SSLException, | ||
is SSLHandshakeException, | ||
is SSLProtocolException, | ||
is UnknownHostException -> null | ||
else -> event | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we include Sentry also has their ANR issues that I am not sure if we need them? https://sentry.io/organizations/home-assistant-io/issues/1863659368/?project=5372876&query=is%3Aunresolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because of how the dependencies are setup we can't right now, but we can explore in the future.
ANR (App not responding) are events we should investigate further. Most likely means we are doing something on the main thread we shouldn't be. |
||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.homeassistant.companion.android | ||
|
||
import android.content.Context | ||
|
||
fun initCrashReporting(context: Context) { | ||
// Noop | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now, disregard my deleted comment lol