To include the Datadog integration for Glide 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-trace:<latest-version>"
implementation "com.datadoghq:dd-sdk-android-glide:<latest-version>"
}
- Setup RUM monitoring, see the dedicated Datadog Android RUM Collection documentation to learn how.
- Setup Trace monitoring, see the dedicated Datadog Android Trace Collection documentation to learn how.
- Following Glide's Generated API documentation, you then need to create your own
GlideAppModule
with Datadog integrations by extending theDatadogGlideModule
, as follow.
Doing so will automatically track Glide's network requests (creating both APM Traces and RUM Resource events), and will also listen for disk cache and image transformation errors (creating RUM Error events).
@GlideModule
class CustomGlideModule :
DatadogGlideModule(
firstPartyHosts = listOf("example.com", "example.eu"), sampleRate = 20f
)
Network requests are sampled with an adjustable sampling rate. A sampling of 20% is applied by default.
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.