Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.5 KB

File metadata and controls

53 lines (37 loc) · 1.5 KB

Datadog Integration for RxJava

Getting Started

To include the Datadog integration for RxJava in your project, simply add the following to your application's build.gradle file.

dependencies {
    implementation "com.datadoghq:dd-sdk-android-rum:<latest-version>"
    implementation "com.datadoghq:dd-sdk-android-rx:<latest-version>"
}

Initial Setup

  1. Setup RUM monitoring, see the dedicated Datadog Android RUM Collection documentation to learn how.
  2. Following RxJava's Generated API documentation, you just have to apply the doOnError operator on your Observable, Flowable, Single, Maybe or Completable and pass an instance of DatadogErrorConsumer.

Doing so will automatically intercept any Exception thrown in the upper stream by creating RUM Error events.

Note : If you are using Kotlin in your codebase you could also use the extension: sendErrorToDatadog().

Java:

    Observable.create<T>{...}
    .doOnError(new DatadogErrorConsumer())
    ...

Kotlin:

    Observable.create<T>{...}
    .publishErrorsToRum()
    ...

Contributing

Pull requests are welcome, but please open an issue first to discuss what you would like to change. For more information, read the Contributing Guide.

License

Apache License, v2.0