https://kotlinlang.org logo
Title
j

jmfayard

11/19/2021, 12:47 PM
Hello friends, what are you using for error monitoring? Bugsnag, Raygun, Sentry ? What's the experience of using them with ktor like?
r

Rescribet

11/19/2021, 2:16 PM
We have Bugsnag in a project and I’ve just done a rudimentary integration of Sentry into a project (since GitLab supports that API). Basic integration is quite simple:
val bugsnag = Bugsnag(reportingKey)
Sentry.init { options ->
   options.dsn = dsn
}

install(StatusPages) {
  exception<Exception> { cause ->
    bugsnag.notify(cause)
    // Either / or
    Sentry.captureException(cause)

    call.respond(HttpStatusCode.InternalServerError)
  }
}
Some plugin which wraps the call to augment it with request information would be useful, but that’s not very high on my TODO list.
:thank-you: 1