Skip to content

Commit 71b124b

Browse files
authored
Merge pull request #2665 from DataDog/xgouchet/RUM-9502/remove_deprecated
RUM-9502 Remove deprecated DatadogInterceptor constructors
2 parents 887fd1d + 2e675ad commit 71b124b

File tree

3 files changed

+1
-170
lines changed

3 files changed

+1
-170
lines changed

integrations/dd-sdk-android-okhttp/api/apiSurface

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ class com.datadog.android.okhttp.DatadogEventListener : okhttp3.EventListener
1616
constructor(String? = null)
1717
override fun create(okhttp3.Call): okhttp3.EventListener
1818
open class com.datadog.android.okhttp.DatadogInterceptor : com.datadog.android.okhttp.trace.TracingInterceptor
19-
DEPRECATED constructor(String? = null, Map<String, Set<com.datadog.android.trace.TracingHeaderType>>, com.datadog.android.okhttp.trace.TracedRequestListener = NoOpTracedRequestListener(), com.datadog.android.rum.RumResourceAttributesProvider = NoOpRumResourceAttributesProvider(), com.datadog.android.core.sampling.Sampler<io.opentracing.Span> = DeterministicTraceSampler(DEFAULT_TRACE_SAMPLE_RATE))
20-
DEPRECATED constructor(String? = null, List<String>, com.datadog.android.okhttp.trace.TracedRequestListener = NoOpTracedRequestListener(), com.datadog.android.rum.RumResourceAttributesProvider = NoOpRumResourceAttributesProvider(), com.datadog.android.core.sampling.Sampler<io.opentracing.Span> = DeterministicTraceSampler(DEFAULT_TRACE_SAMPLE_RATE))
21-
DEPRECATED constructor(String? = null, com.datadog.android.okhttp.trace.TracedRequestListener = NoOpTracedRequestListener(), com.datadog.android.rum.RumResourceAttributesProvider = NoOpRumResourceAttributesProvider(), com.datadog.android.core.sampling.Sampler<io.opentracing.Span> = DeterministicTraceSampler(DEFAULT_TRACE_SAMPLE_RATE))
2219
override fun intercept(okhttp3.Interceptor.Chain): okhttp3.Response
2320
override fun onRequestIntercepted(com.datadog.android.api.feature.FeatureSdkCore, okhttp3.Request, io.opentracing.Span?, okhttp3.Response?, Throwable?)
2421
override fun canSendSpan(): Boolean

integrations/dd-sdk-android-okhttp/api/dd-sdk-android-okhttp.api

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,6 @@ public final class com/datadog/android/okhttp/DatadogEventListener$Factory : okh
2222
}
2323

2424
public class com/datadog/android/okhttp/DatadogInterceptor : com/datadog/android/okhttp/trace/TracingInterceptor {
25-
public fun <init> ()V
26-
public fun <init> (Ljava/lang/String;)V
27-
public fun <init> (Ljava/lang/String;Lcom/datadog/android/okhttp/trace/TracedRequestListener;)V
28-
public fun <init> (Ljava/lang/String;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;)V
29-
public fun <init> (Ljava/lang/String;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;Lcom/datadog/android/core/sampling/Sampler;)V
30-
public synthetic fun <init> (Ljava/lang/String;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;Lcom/datadog/android/core/sampling/Sampler;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
31-
public fun <init> (Ljava/lang/String;Ljava/util/List;)V
32-
public fun <init> (Ljava/lang/String;Ljava/util/List;Lcom/datadog/android/okhttp/trace/TracedRequestListener;)V
33-
public fun <init> (Ljava/lang/String;Ljava/util/List;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;)V
34-
public fun <init> (Ljava/lang/String;Ljava/util/List;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;Lcom/datadog/android/core/sampling/Sampler;)V
35-
public synthetic fun <init> (Ljava/lang/String;Ljava/util/List;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;Lcom/datadog/android/core/sampling/Sampler;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
36-
public fun <init> (Ljava/lang/String;Ljava/util/Map;)V
37-
public fun <init> (Ljava/lang/String;Ljava/util/Map;Lcom/datadog/android/okhttp/trace/TracedRequestListener;)V
38-
public fun <init> (Ljava/lang/String;Ljava/util/Map;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;)V
39-
public fun <init> (Ljava/lang/String;Ljava/util/Map;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;Lcom/datadog/android/core/sampling/Sampler;)V
40-
public synthetic fun <init> (Ljava/lang/String;Ljava/util/Map;Lcom/datadog/android/okhttp/trace/TracedRequestListener;Lcom/datadog/android/rum/RumResourceAttributesProvider;Lcom/datadog/android/core/sampling/Sampler;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
41-
public fun <init> (Ljava/util/List;)V
42-
public fun <init> (Ljava/util/Map;)V
4325
public fun intercept (Lokhttp3/Interceptor$Chain;)Lokhttp3/Response;
4426
protected fun onRequestIntercepted (Lcom/datadog/android/api/feature/FeatureSdkCore;Lokhttp3/Request;Lio/opentracing/Span;Lokhttp3/Response;Ljava/lang/Throwable;)V
4527
}

integrations/dd-sdk-android-okhttp/src/main/kotlin/com/datadog/android/okhttp/DatadogInterceptor.kt

Lines changed: 1 addition & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import com.datadog.android.core.sampling.Sampler
1616
import com.datadog.android.okhttp.internal.rum.NoOpRumResourceAttributesProvider
1717
import com.datadog.android.okhttp.internal.rum.buildResourceId
1818
import com.datadog.android.okhttp.internal.utils.traceIdAsHexString
19-
import com.datadog.android.okhttp.trace.DeterministicTraceSampler
20-
import com.datadog.android.okhttp.trace.NoOpTracedRequestListener
2119
import com.datadog.android.okhttp.trace.TracedRequestListener
2220
import com.datadog.android.okhttp.trace.TracingInterceptor
2321
import com.datadog.android.rum.GlobalRumMonitor
@@ -92,153 +90,6 @@ open class DatadogInterceptor internal constructor(
9290
localTracerFactory
9391
) {
9492

95-
/**
96-
* Creates a [TracingInterceptor] to automatically create a trace around OkHttp [Request]s, and
97-
* track RUM Resources.
98-
*
99-
* @param sdkInstanceName SDK instance name to bind to, or null to check the default instance.
100-
* Instrumentation won't be working until SDK instance is ready.
101-
* @param firstPartyHostsWithHeaderType the list of all the hosts and header types that you want to
102-
* be automatically tracked by this interceptor.
103-
* Requests made to a URL with any one of these hosts (or any subdomain) will:
104-
* - be considered a first party RUM Resource and categorised as such in your RUM dashboard;
105-
* - be wrapped in a Span and have trace id injected to get a full flame-graph in APM.
106-
* If no host provided (via this argument, global configuration [Configuration.Builder.setFirstPartyHosts]
107-
* or [Configuration.Builder.setFirstPartyHostsWithHeaderType])
108-
* the interceptor won't trace any OkHttp [Request], nor propagate tracing
109-
* information to the backend, but RUM Resource events will still be sent for each request.
110-
* @param tracedRequestListener which listens on the intercepted [okhttp3.Request] and offers
111-
* the possibility to modify the created [io.opentracing.Span].
112-
* @param rumResourceAttributesProvider which listens on the intercepted [okhttp3.Request]
113-
* and offers the possibility to add custom attributes to the RUM resource events.
114-
* @param traceSampler Sampler controlling the sampling of APM traces created for
115-
* auto-instrumented requests. By default it is [DeterministicTraceSampler], which either can accept
116-
* fixed sample rate or can get it dynamically from the provider. Value between `0.0` and
117-
* `100.0`. A value of `0.0` means no trace will be kept, `100.0` means all traces will
118-
* be kept (default value is `100.0`).
119-
*/
120-
@JvmOverloads
121-
@Deprecated(
122-
message = "This constructor is not going to be accessible anymore in future versions. " +
123-
"Please use the Builder instead.",
124-
replaceWith = ReplaceWith("DatadogInterceptor.Builder(tracedHosts).build()")
125-
)
126-
constructor(
127-
sdkInstanceName: String? = null,
128-
firstPartyHostsWithHeaderType: Map<String, Set<TracingHeaderType>>,
129-
tracedRequestListener: TracedRequestListener = NoOpTracedRequestListener(),
130-
rumResourceAttributesProvider: RumResourceAttributesProvider =
131-
NoOpRumResourceAttributesProvider(),
132-
traceSampler: Sampler<Span> = DeterministicTraceSampler(DEFAULT_TRACE_SAMPLE_RATE)
133-
) : this(
134-
sdkInstanceName = sdkInstanceName,
135-
tracedHosts = firstPartyHostsWithHeaderType,
136-
tracedRequestListener = tracedRequestListener,
137-
rumResourceAttributesProvider = rumResourceAttributesProvider,
138-
traceSampler = traceSampler,
139-
traceContextInjection = TraceContextInjection.SAMPLED,
140-
redacted404ResourceName = true,
141-
localTracerFactory = { sdkCore, tracingHeaderTypes ->
142-
AndroidTracer.Builder(sdkCore).setTracingHeaderTypes(tracingHeaderTypes).build()
143-
}
144-
)
145-
146-
/**
147-
* Creates a [DatadogInterceptor] to automatically create a trace around OkHttp [Request]s, and
148-
* track RUM Resources.
149-
*
150-
* @param sdkInstanceName SDK instance name to bind to, or null to check the default instance.
151-
* Instrumentation won't be working until SDK instance is ready.
152-
* @param firstPartyHosts the list of first party hosts.
153-
* Requests made to a URL with any one of these hosts (or any subdomain) will:
154-
* - be considered a first party RUM Resource and categorised as such in your RUM dashboard;
155-
* - be wrapped in a Span and have trace id injected to get a full flame-graph in APM.
156-
* If no host provided (via this argument, global configuration [Configuration.Builder.setFirstPartyHosts]
157-
* or [Configuration.Builder.setFirstPartyHostsWithHeaderType])
158-
* the interceptor won't trace any OkHttp [Request], nor propagate tracing
159-
* information to the backend, but RUM Resource events will still be sent for each request.
160-
* @param tracedRequestListener which listens on the intercepted [okhttp3.Request] and offers
161-
* the possibility to modify the created [io.opentracing.Span].
162-
* @param rumResourceAttributesProvider which listens on the intercepted [okhttp3.Request]
163-
* and offers the possibility to add custom attributes to the RUM resource events.
164-
* @param traceSampler Sampler controlling the sampling of APM traces created for
165-
* auto-instrumented requests. By default it is [DeterministicTraceSampler], which either can accept
166-
* fixed sample rate or can get it dynamically from the provider. Value between `0.0` and
167-
* `100.0`. A value of `0.0` means no trace will be kept, `100.0` means all traces will
168-
* be kept (default value is `100.0`).
169-
*/
170-
@JvmOverloads
171-
@Deprecated(
172-
message = "This constructor is not going to be accessible anymore in future versions. " +
173-
"Please use the Builder instead.",
174-
replaceWith = ReplaceWith("DatadogInterceptor.Builder(tracedHosts).build()")
175-
)
176-
constructor(
177-
sdkInstanceName: String? = null,
178-
firstPartyHosts: List<String>,
179-
tracedRequestListener: TracedRequestListener = NoOpTracedRequestListener(),
180-
rumResourceAttributesProvider: RumResourceAttributesProvider =
181-
NoOpRumResourceAttributesProvider(),
182-
traceSampler: Sampler<Span> = DeterministicTraceSampler(DEFAULT_TRACE_SAMPLE_RATE)
183-
) : this(
184-
sdkInstanceName = sdkInstanceName,
185-
tracedHosts = firstPartyHosts.associateWith {
186-
setOf(
187-
TracingHeaderType.DATADOG,
188-
TracingHeaderType.TRACECONTEXT
189-
)
190-
},
191-
tracedRequestListener = tracedRequestListener,
192-
rumResourceAttributesProvider = rumResourceAttributesProvider,
193-
traceSampler = traceSampler,
194-
traceContextInjection = TraceContextInjection.SAMPLED,
195-
redacted404ResourceName = true,
196-
localTracerFactory = { sdkCore, tracingHeaderTypes ->
197-
AndroidTracer.Builder(sdkCore).setTracingHeaderTypes(tracingHeaderTypes).build()
198-
}
199-
)
200-
201-
/**
202-
* Creates a [TracingInterceptor] to automatically create a trace around OkHttp [Request]s, and
203-
* track RUM Resources.
204-
*
205-
* @param sdkInstanceName SDK instance name to bind to, or null to check the default instance.
206-
* Instrumentation won't be working until SDK instance is ready.
207-
* @param tracedRequestListener which listens on the intercepted [okhttp3.Request] and offers
208-
* the possibility to modify the created [io.opentracing.Span].
209-
* @param rumResourceAttributesProvider which listens on the intercepted [okhttp3.Request]
210-
* and offers the possibility to add custom attributes to the RUM resource events.
211-
* @param traceSampler Sampler controlling the sampling of APM traces created for
212-
* auto-instrumented requests. By default it is [DeterministicTraceSampler], which either can accept
213-
* fixed sample rate or can get it dynamically from the provider. Value between `0.0` and
214-
* `100.0`. A value of `0.0` means no trace will be kept, `100.0` means all traces will
215-
* be kept (default value is `100.0`).
216-
*/
217-
@JvmOverloads
218-
@Deprecated(
219-
message = "This constructor is not going to be accessible anymore in future versions. " +
220-
"Please use the Builder instead.",
221-
replaceWith = ReplaceWith("DatadogInterceptor.Builder(tracedHosts).build()")
222-
)
223-
constructor(
224-
sdkInstanceName: String? = null,
225-
tracedRequestListener: TracedRequestListener = NoOpTracedRequestListener(),
226-
rumResourceAttributesProvider: RumResourceAttributesProvider =
227-
NoOpRumResourceAttributesProvider(),
228-
traceSampler: Sampler<Span> = DeterministicTraceSampler(DEFAULT_TRACE_SAMPLE_RATE)
229-
) : this(
230-
sdkInstanceName = sdkInstanceName,
231-
tracedHosts = emptyMap(),
232-
tracedRequestListener = tracedRequestListener,
233-
rumResourceAttributesProvider = rumResourceAttributesProvider,
234-
traceSampler = traceSampler,
235-
traceContextInjection = TraceContextInjection.SAMPLED,
236-
redacted404ResourceName = true,
237-
localTracerFactory = { sdkCore, tracingHeaderTypes ->
238-
AndroidTracer.Builder(sdkCore).setTracingHeaderTypes(tracingHeaderTypes).build()
239-
}
240-
)
241-
24293
// region Interceptor
24394

24495
/** @inheritdoc */
@@ -435,6 +286,7 @@ open class DatadogInterceptor internal constructor(
435286
// endregion
436287

437288
// region Builder
289+
438290
/**
439291
* A Builder for the [DatadogInterceptor].
440292
* @param tracedHostsWithHeaderType a list of all the hosts and header types that you want to

0 commit comments

Comments
 (0)