Skip to content
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

Datadog support #49

Open
kirillzh opened this issue Feb 20, 2023 · 1 comment
Open

Datadog support #49

kirillzh opened this issue Feb 20, 2023 · 1 comment

Comments

@kirillzh
Copy link

We use Datadog for crash reports, would love to migrate over to Kermit for that, but it doesn't currently support Datadog. Wondering if there is any existing work around that, or what's an estimated amount effort to add the support?

@alexfanatics
Copy link

alexfanatics commented Mar 5, 2024

We looked into this for a bit too. I think the main issue with Datadog compatibility is symbolication of exception stack traces.

Symbolication isn't yet supported for other kind of errors (log errors, span errors nor manually collected RUM errors)

DataDog/dd-sdk-ios#1572 (comment)

Crashlytics + Bugsnag have an easy API to log an Exception along with the stacktrace which will be symbolicated on the web app, but it seems that Datadog does not support this.

// firebase
val exceptionClassName = throwable::class.qualifiedName
val exModel = FIRExceptionModel.exceptionModelWithName(exceptionClassName, throwable.message)!!
exModel.setStackTrace(throwable.getFilteredStackTraceAddresses().map { FIRStackFrame.stackFrameWithAddress(it.convert()) })
FIRCrashlytics.crashlytics().recordExceptionModel(exModel)

// bugsnag
val exception = throwable.asNSException()
val causes = throwable.causes.map { it.asNSException() }
// Notify will persist unhandled events, so we can safely terminate afterwards.
// https://github.com/bugsnag/bugsnag-cocoa/blob/6bcd46f5f8dc06ac26537875d501f02b27d219a9/Bugsnag/Client/BugsnagClient.m#L744
Bugsnag.notify(exception) { event ->
    if (event == null) return@notify true

    if (handled) {
        event.severity = BSGSeverity.BSGSeverityWarning
    } else {
        event.unhandled = true
        event.severity = BSGSeverity.BSGSeverityError
    }

    if (causes.isNotEmpty()) {
        event.errors += causes.map { it.asBugsnagError() }
    }

    true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants