From e95a0a9d85d83c6f5ac7595f19ad53bc15909afb Mon Sep 17 00:00:00 2001 From: Pim van Nierop Date: Fri, 19 Jul 2024 15:05:15 +0200 Subject: [PATCH] Add Bugsnag monitoring --- data-dashboard-backend/build.gradle.kts | 2 ++ .../java/org/radarbase/datadashboard/api/DashboardApi.kt | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/data-dashboard-backend/build.gradle.kts b/data-dashboard-backend/build.gradle.kts index f10b54c..1d044e5 100644 --- a/data-dashboard-backend/build.gradle.kts +++ b/data-dashboard-backend/build.gradle.kts @@ -24,6 +24,8 @@ dependencies { implementation("com.mindscapehq:core:3.0.0") implementation("com.mindscapehq:webprovider:3.0.0") + implementation("com.bugsnag:bugsnag:3.+") + testImplementation("org.mockito:mockito-core:${Versions.mockitoKotlin}") testImplementation("org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}") testImplementation("org.glassfish.jersey.test-framework:jersey-test-framework-core:${Versions.jersey}") diff --git a/data-dashboard-backend/src/main/java/org/radarbase/datadashboard/api/DashboardApi.kt b/data-dashboard-backend/src/main/java/org/radarbase/datadashboard/api/DashboardApi.kt index 5a0360f..314ba40 100644 --- a/data-dashboard-backend/src/main/java/org/radarbase/datadashboard/api/DashboardApi.kt +++ b/data-dashboard-backend/src/main/java/org/radarbase/datadashboard/api/DashboardApi.kt @@ -18,6 +18,7 @@ package org.radarbase.datadashboard.api +import com.bugsnag.Bugsnag import com.mindscapehq.raygun4java.core.IRaygunClientFactory import com.mindscapehq.raygun4java.core.RaygunClient import com.mindscapehq.raygun4java.core.RaygunClientFactory @@ -64,11 +65,14 @@ object Main { .withData("prod", false) val raygunClient: RaygunClient = raygunFactory.newClient() + val bugsnag: Bugsnag = Bugsnag("28921adc65be4fd1643684b73ab0b636") + try { throw Exception("This is a test exception") } catch (e: Exception) { - Sentry.captureException(e); + Sentry.captureException(e) raygunClient.send(e) + bugsnag.notify(e) } GrizzlyServer(config.service.baseUri, resources).run {