-
- All Implemented Interfaces:
-
okhttp3.Interceptor
public final class RumInterceptor extends DatadogInterceptor
Provides automatic RUM integration for OkHttpClient by way of the Interceptor system.
This interceptor will log the request as a RUM Resource, and fill the request information (url, method, status code, optional error). Note that RUM Resources are only tracked when a view is active. You can use one of the existing ViewTrackingStrategy when configuring the SDK (see Configuration.Builder.useViewTrackingStrategy) or start a view manually (see RumMonitor.startView).
If you use multiple Interceptors, make sure that this one is called first. If you also want to trace network request, use the DatadogInterceptor instead, which combines the RUM and APM integrations.
To use:
OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new RumInterceptor()) .build();
-
-
Constructor Summary
Constructors Constructor Description RumInterceptor(List<String> firstPartyHosts, RumResourceAttributesProvider rumResourceAttributesProvider, Float traceSamplingRate)
-
Method Summary
Modifier and Type Method Description -
-
Constructor Detail
-
RumInterceptor
RumInterceptor(List<String> firstPartyHosts, RumResourceAttributesProvider rumResourceAttributesProvider, Float traceSamplingRate)
- Parameters:
firstPartyHosts- the list of first party hosts.rumResourceAttributesProvider- which listens on the intercepted okhttp3.Request and offers the possibility to add custom attributes to the RUM resource events.traceSamplingRate- the sampling rate for APM traces created for auto-instrumented requests.
-
-
-
-