Skip to content

Commit 6a90f1e

Browse files
authored
Merge pull request #2853 from DataDog/tvaleev/feature/RUM-11586-v3-release-preparation
SDK v3 release preparation
2 parents 7c14e3d + 948c1a9 commit 6a90f1e

40 files changed

+2117
-273
lines changed

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,50 @@
1+
# 3.0.0 / 2025-09-04
2+
3+
This is the first official production version of SDK v3 containing the new architecture for tracing feature. See the [migration guide](https://github.com/DataDog/dd-sdk-android/blob/develop/MIGRATION.MD) for details.
4+
5+
* [FEATURE] RUM: Create view attributes update methods. See [#2655](https://github.com/DataDog/dd-sdk-android/pull/2655)
6+
* [IMPROVEMENT] Trace: Using `100%` instead of `20%` for the default network tracing sampling rate. Using `SAMPLED` instead of `ALL` as the default `TraceContextInjection` strategy. See [#2542](https://github.com/DataDog/dd-sdk-android/pull/2542)
7+
* [IMPROVEMENT] Trace: Using session consistent trace sampling. See [#2544](https://github.com/DataDog/dd-sdk-android/pull/2544)
8+
* [IMPROVEMENT] Core: Resolve batch file only during the actual write call. See [#2619](https://github.com/DataDog/dd-sdk-android/pull/2619)
9+
* [IMPROVEMENT] Remove `forceNewBatch` API. See [#2621](https://github.com/DataDog/dd-sdk-android/pull/2621)
10+
* [IMPROVEMENT] Core: Resolve file orchestrator for write operation from `DatadogContext`. See [#2624](https://github.com/DataDog/dd-sdk-android/pull/2624)
11+
* [IMPROVEMENT] Introduce event processing thread. See [#2631](https://github.com/DataDog/dd-sdk-android/pull/2631)
12+
* [IMPROVEMENT] Core: Push context changes from public API to the context thread. See [#2635](https://github.com/DataDog/dd-sdk-android/pull/2635)
13+
* [IMPROVEMENT] Core: Make `getDatadogContext` read on the context thread. See [#2645](https://github.com/DataDog/dd-sdk-android/pull/2645)
14+
* [IMPROVEMENT] RUM: Update RUM feature context only after event processing completion. See [#2650](https://github.com/DataDog/dd-sdk-android/pull/2650)
15+
* [IMPROVEMENT] RUM: Align attribute propagation mechanism. See [#2654](https://github.com/DataDog/dd-sdk-android/pull/2654)
16+
* [IMPROVEMENT] Trace: Perform lazy capture of `DatadogContext` at the span creation. See [#2662](https://github.com/DataDog/dd-sdk-android/pull/2662)
17+
* [IMPROVEMENT] Trace: Remove deprecated `DatadogInterceptor` constructors. See [#2665](https://github.com/DataDog/dd-sdk-android/pull/2665)
18+
* [IMPROVEMENT] Read RUM context in Session Replay in non-blocking manner. See [#2666](https://github.com/DataDog/dd-sdk-android/pull/2666)
19+
* [IMPROVEMENT] RUM: Propagate `has_replay` flag to `RumContext` object. See [#2668](https://github.com/DataDog/dd-sdk-android/pull/2668)
20+
* [IMPROVEMENT] RUM: Remove deprecated `startResource`. See [#2671](https://github.com/DataDog/dd-sdk-android/pull/2671)
21+
* [IMPROVEMENT] RUM: Remove deprecated `userInfo` methods. See [#2672](https://github.com/DataDog/dd-sdk-android/pull/2672)
22+
* [IMPROVEMENT] Custom endpoint URL are taken as is. See [#2685](https://github.com/DataDog/dd-sdk-android/pull/2685)
23+
* [IMPROVEMENT] Logs: Don't send fatal errors to Logs, only send them to RUM. See [#2675](https://github.com/DataDog/dd-sdk-android/pull/2675)
24+
* [IMPROVEMENT] Process feature context on the context thread. See [#2704](https://github.com/DataDog/dd-sdk-android/pull/2704)
25+
* [IMPROVEMENT] Read feature context only when explicitly requested by the caller. See [#2716](https://github.com/DataDog/dd-sdk-android/pull/2716)
26+
* [IMPROVEMENT] Avoid polling for `RumContext` in `VitalReaderRunnable`. See [#2728](https://github.com/DataDog/dd-sdk-android/pull/2728)
27+
* [IMPROVEMENT] Remove feature name argument from APIs to set/remove feature context update listener. See [#2729](https://github.com/DataDog/dd-sdk-android/pull/2729)
28+
* [IMPROVEMENT] Core: Mark `CoreFeature` properties used to create `DatadogContext` as volatile. See [#2738](https://github.com/DataDog/dd-sdk-android/pull/2738)
29+
* [IMPROVEMENT] Core: Handle the case when `DatadogContext` is requested when SDK is getting deinitialized. See [#2740](https://github.com/DataDog/dd-sdk-android/pull/2740)
30+
* [IMPROVEMENT] Core: Monitor backpressure of context executor. See [#2745](https://github.com/DataDog/dd-sdk-android/pull/2745)
31+
* [IMPROVEMENT] Core: Remove default value for the `addAccountExtraInfo` call. See [#2759](https://github.com/DataDog/dd-sdk-android/pull/2759)
32+
* [IMPROVEMENT] RUM: Make attributes argument optional in the event-related methods of RUM monitor. See [#2760](https://github.com/DataDog/dd-sdk-android/pull/2760)
33+
* [IMPROVEMENT] Trace: Remove OpenTracing dependencies . See [#2783](https://github.com/DataDog/dd-sdk-android/pull/2783)
34+
* [IMPROVEMENT] Trace: Update OpenTelemetry version. See [#2786](https://github.com/DataDog/dd-sdk-android/pull/2786)
35+
* [IMPROVEMENT] Trace: Isolate implementation layer from integration modules. See [#2773](https://github.com/DataDog/dd-sdk-android/pull/2773)
36+
* [IMPROVEMENT] Properties referencing support. See [#2793](https://github.com/DataDog/dd-sdk-android/pull/2793)
37+
* [IMPROVEMENT] Use common-schema for common object generation. See [#2794](https://github.com/DataDog/dd-sdk-android/pull/2794)
38+
* [IMPROVEMENT] Move session properties to `ddtags` over query parameters. See [#2812](https://github.com/DataDog/dd-sdk-android/pull/2812)
39+
* [IMPROVEMENT] Trace: `TracingInterceptor` migration from OpenTracing to internal implementation. See [#2708](https://github.com/DataDog/dd-sdk-android/pull/2708)
40+
* [IMPROVEMENT] Update Session Replay batch max age to 5h. See [#2842](https://github.com/DataDog/dd-sdk-android/pull/2842)
41+
* [IMPROVEMENT] Core: Fix `clearUserInfo` API by adapting it to the context queue. See [#2847](https://github.com/DataDog/dd-sdk-android/pull/2847)
42+
* [MAINTENANCE] Fix flaky `DatadogRumMonitor` tests. See [#2663](https://github.com/DataDog/dd-sdk-android/pull/2663)
43+
* [MAINTENANCE] Minor cleanup. See [#2669](https://github.com/DataDog/dd-sdk-android/pull/2669)
44+
* [MAINTENANCE] Update sample to use non-null user id. See [#2682](https://github.com/DataDog/dd-sdk-android/pull/2682)
45+
* [MAINTENANCE] Bump Kotlin version used to `2.0.21`. See [#2766](https://github.com/DataDog/dd-sdk-android/pull/2766)
46+
* [MAINTENANCE] Bump `minSdk` version to 23. See [#2844](https://github.com/DataDog/dd-sdk-android/pull/2844)
47+
148
# 2.26.0 / 2025-08-27
249

350
* [FEATURE] RUM: Add battery and display attributes. See [#2815](https://github.com/DataDog/dd-sdk-android/pull/2815)

MIGRATION.MD

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,185 @@
1+
# Migration from 2.x to 3.0
2+
3+
The main changes introduced in SDK 3.0 compared to 2.x are:
4+
5+
1. The `OpenTracing` dependency was removed because it is obsolete.
6+
7+
8+
We replaced the `OpenTracing` classes with internal one. However we strongly encourage you to use the OTel version as the new tracing API standard.
9+
10+
11+
### Trace product changes
12+
13+
#### Migrating tracing from `OpenTracing` to `OpenTelemetry` (recommended)
14+
15+
> [!WARNING]
16+
> Note that the `OpenTelemetry` specification library [requires](https://github.com/open-telemetry/opentelemetry-java?tab=readme-ov-file#requirements) desugaring to be enabled for with projects that have a `minSdk` < 26. If this requirement cannot be met in your project see the following section.
17+
18+
19+
1. Add the `OpenTelemetry` dependency to your `build.gradle.kts`:
20+
21+
```kotlin
22+
implementation(project("com.datadoghq:dd-sdk-android-trace-otel:x.x.x"))
23+
```
24+
25+
2. Replace the `OpenTracing` configuration:
26+
```kotlin
27+
GlobalTracer.registerIfAbsent(
28+
AndroidTracer.Builder()
29+
.setService(BuildConfig.APPLICATION_ID)
30+
.build()
31+
)
32+
```
33+
34+
with the `OpenTelemetry` configuration:
35+
```kotlin
36+
GlobalOpenTelemetry.set(object : OpenTelemetry {
37+
private val tracerProvider = OtelTracerProvider.Builder()
38+
.setService(BuildConfig.APPLICATION_ID)
39+
.build()
40+
41+
override fun getTracerProvider(): TracerProvider {
42+
return tracerProvider
43+
}
44+
45+
override fun getPropagators(): ContextPropagators {
46+
return ContextPropagators.noop()
47+
}
48+
})
49+
```
50+
51+
> [!NOTE]
52+
> You can use the default configuration to make it even shorter in case if don't provide any additional parameters:
53+
```kotlin
54+
GlobalOpenTelemetry.set(
55+
DatadogOpenTelemetry(BuildConfig.APPLICATION_ID)
56+
)
57+
```
58+
59+
To access the tracer object for manual (custom) tracing, use `io.opentelemetry.api.GlobalOpenTelemetry.get()` instead of `io.opentracing.util.GlobalTracer.get()`.
60+
For example:
61+
```kotlin
62+
val tracer: Tracer = GlobalOpenTelemetry
63+
.get()
64+
.getTracer("SampleApplicationTracer")
65+
66+
val span = tracer
67+
.spanBuilder("Executing operation")
68+
.startSpan()
69+
70+
// Code that should be instrumented
71+
72+
span.end()
73+
```
74+
75+
Refer to the official `OpenTelemetry` [documentation](https://opentelemetry.io/docs/) for more details.
76+
77+
#### Migrating tracing from `OpenTracing` to `DatadogTracing` (transition period)
78+
79+
> [!WARNING]
80+
> This option has been added for compatibility and to simplify the transition from `OpenTracing` to `OpenTelemetry`, but it may not be available in future major releases. We recommend using `OpenTelemetry` as the standard for tracing tasks. However, if it is not possible to enable desugaring in your project for some reason, you can use this method.
81+
82+
1. Add the `DatadogTracing` dependency to your `build.gradle.kts`:
83+
84+
```kotlin
85+
implementation(project("com.datadoghq:dd-sdk-android-trace-otel:x.x.x"))
86+
```
87+
88+
89+
2.Replace the `OpenTracing` configuration:
90+
```kotlin
91+
GlobalTracer.registerIfAbsent(
92+
AndroidTracer.Builder()
93+
.setService(BuildConfig.APPLICATION_ID)
94+
.build()
95+
)
96+
```
97+
98+
with the `DatadogTracing` configuration:
99+
```kotlin
100+
GlobalDatadogTracer.registerIfAbsent(
101+
DatadogTracing.newTracerBuilder()
102+
.build()
103+
)
104+
```
105+
106+
107+
For manual (custom) tracing use `com.datadog.android.trace.GlobalDatadogTracer.get()` instead of `io.opentracing.util.GlobalTracer.get()` to access the tracer object.
108+
For example:
109+
```kotlin
110+
val tracer = GlobalDatadogTracer.get()
111+
112+
val span = tracer
113+
.buildSpan(operationName)
114+
.start()
115+
116+
// Code that should be instrumented
117+
118+
span.finish()
119+
```
120+
Refer to the Datadog [documentation](https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/dd_libraries/android?tab=kotlin) for more details.
121+
122+
API changes:
123+
124+
|`2.x`|`3.0` `OpenTelemetry`|`3.0` `DatadogTracing`|
125+
|---|---|---|
126+
|`io.opentracing.util.GlobalTracer`|`io.opentelemetry.api.GlobalOpenTelemetry`|`com.datadog.android.trace.GlobalDatadogTracer`|
127+
|`com.datadog.android.trace.AndroidTracer`|`io.opentelemetry.api.trace.Tracer`|`com.datadog.android.trace.api.tracer.DatadogTracer`|
128+
|`io.opentracing.Span`|`io.opentelemetry.api.trace.Span`|`com.datadog.android.trace.api.span.DatadogSpan`|
129+
|`io.opentracing.Scope`|`io.opentelemetry.context.Scope`|`com.datadog.android.trace.api.scope.DatadogScope`|
130+
|`io.opentracing.SpanContext`|`io.opentelemetry.api.trace.SpanContext`|`com.datadog.android.trace.api.span.DatadogSpanContext`|
131+
132+
Replacement hints:
133+
134+
|`2.x`|`3.0` `OpenTelemetry`|`3.0` `DatadogTracing`|
135+
|---|---|---|
136+
|`AndroidTracer.Builder().build()`||`DatadogTracing.newTracerBuilder().build()`|
137+
|`AndroidTracer#setPartialFlushThreshold(Int)`|`OtelTracerProvider#setPartialFlushThreshold()`|`DatadogTracerBuilder#withPartialFlushMinSpans()`|
138+
|`io.opentracing.SpanContext#toTraceId()`|`io.opentelemetry.api.trace.SpanContext#getTraceId()`|`DatadogSpanContext.traceId.toString()`|
139+
|`io.opentracing.Span#setError()`|`io.opentelemetry.api.trace#recordException()`|`DatadogSpan#addThrowable()`|
140+
141+
### OkHttp instrumentation changes
142+
143+
The OkHttp instrumentation (`com.datadoghq:dd-sdk-android-okhttp:x.x.x`) doesn't require desugaring support. However few migration actions may be necessary.
144+
145+
146+
API changes:
147+
148+
|`2.x`|`3.0`|
149+
|--|--|
150+
|`TracingInterceptor(String, List<String>, TracedRequestListener,Sampler<Span>)`| Use `TracingInterceptor.Builder()` instead.|
151+
|`TracingInterceptor(String?,Map<String, Set<TracingHeaderType>>, TracedRequestListener, Sampler<Span>)`| Use `TracingInterceptor.Builder()` instead.|
152+
|`TracingInterceptor(String?,TracedRequestListener,Sampler<Span>)`|Use `TracingInterceptor.Builder()` instead.|
153+
|`DatadogInterceptor(String?, Map<String, Set<TracingHeaderType>>,TracedRequestListener, RumResourceAttributesProvider, Sampler<Span>)`|Use `DatadogInterceptor.Builder()` instead. |
154+
|`DatadogInterceptor(String?,List<String>,TracedRequestListener,RumResourceAttributesProvider,Sampler<Span>)`|Use `DatadogInterceptor.Builder()` instead.|
155+
| `DatadogInterceptor(String?,TracedRequestListener,RumResourceAttributesProvider,Sampler<Span>) ` | Use `DatadogInterceptor.Builder()` instead. |
156+
157+
158+
### Core product changes
159+
160+
API changes:
161+
162+
|`2.x`| `3.0` |
163+
|--|------------------------------------------------------------------|
164+
|`Datadog#setUserInfo(String?, ...)`| User info ID is now mandatory `Datadog.setUserInfo(String, ...)` |
165+
166+
167+
### RUM product changes
168+
169+
API changes:
170+
171+
|`2.x`| `3.0` |
172+
|--|-------------------------------------------------------------------------------------|
173+
|`DatadogRumMonitor#startResource(String, String, String,Map<String, Any?>)`| Use `startResource` method which takes `RumHttpMethod` as `method` parameter instead |
174+
|`com.datadog.android.rum.GlobalRum`|`GlobalRum` object was renamed to `com.datadog.android.rum.GlobalRumMonitor` |
175+
|`com.datadog.android.rum.RumMonitor#addAction()`| Parameter `attributes: Map<String, Any?>` is now optional |
176+
|`com.datadog.android.rum.RumMonitor#startAction()`| Parameter `attributes: Map<String, Any?>` is now optional |
177+
|`com.datadog.android.rum.RumMonitor#stopResource()`| Parameter `attributes: Map<String, Any?>` is now optional |
178+
|`com.datadog.android.rum.RumMonitor#addError()`| Parameter `attributes: Map<String, Any?>` is now optional |
179+
|`com.datadog.android.rum.RumMonitor#addErrorWithStacktrace()`| Parameter `attributes: Map<String, Any?>` is now optional |
180+
|`com.datadog.android.rum.internal.monitor.AdvancedNetworkRumMonitor#stopResource()`| Parameter `attributes: Map<String, Any?>` is now optional |
181+
|`com.datadog.android.rum.internal.monitor.AdvancedNetworkRumMonitor#stopResource()`| Parameter `attributes: Map<String, Any?>` is now optional |
182+
1183
# Migration from 1.x to 2.0
2184

3185
The main changes introduced in SDK 2.0 compared to 1.x are:

buildSrc/src/main/kotlin/com/datadog/gradle/config/AndroidConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object AndroidConfig {
2020
const val MIN_SDK_FOR_AUTO = 29
2121
const val BUILD_TOOLS_VERSION = "36.0.0"
2222

23-
val VERSION = Version(3, 0, 0, Version.Type.Snapshot)
23+
val VERSION = Version(3, 0, 0, Version.Type.Release)
2424
}
2525

2626
// TODO RUM-628 Switch to Java 17 bytecode

features/dd-sdk-android-rum/build.gradle.kts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ android {
5050
}
5151

5252
namespace = "com.datadog.android.rum"
53-
54-
testFixtures {
55-
enable = true
56-
}
5753
}
5854

5955
dependencies {
@@ -91,22 +87,6 @@ dependencies {
9187
testImplementation(testFixtures(project(":dd-sdk-android-internal")))
9288
testImplementation(testFixtures(project(":features:dd-sdk-android-trace")))
9389
unmock(libs.robolectric)
94-
95-
// Test Fixtures
96-
testFixturesImplementation(testFixtures(project(":dd-sdk-android-core")))
97-
testFixturesImplementation(testFixtures(project(":dd-sdk-android-internal")))
98-
testFixturesImplementation(project(":tools:unit")) {
99-
attributes {
100-
attribute(
101-
com.android.build.api.attributes.ProductFlavorAttr.of("platform"),
102-
objects.named("jvm")
103-
)
104-
}
105-
}
106-
testFixturesImplementation(libs.kotlin)
107-
testFixturesImplementation(libs.bundles.jUnit5)
108-
testFixturesImplementation(libs.okHttp)
109-
testFixturesImplementation(libs.bundles.testTools)
11090
}
11191

11292
unMock {

features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/DatadogLateCrashReporter.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import com.datadog.android.rum.internal.domain.RumContext
2525
import com.datadog.android.rum.internal.domain.event.RumEventDeserializer
2626
import com.datadog.android.rum.internal.domain.scope.toErrorSchemaType
2727
import com.datadog.android.rum.internal.domain.scope.tryFromSource
28-
import com.datadog.android.rum.internal.utils.buildDDTagsString
2928
import com.datadog.android.rum.model.ErrorEvent
3029
import com.datadog.android.rum.model.ViewEvent
3130
import com.google.gson.JsonObject
@@ -273,8 +272,7 @@ internal class DatadogLateCrashReporter(
273272
},
274273
timeSinceAppStart = timeSinceAppStartMs
275274
),
276-
version = viewEvent.version,
277-
ddtags = buildDDTagsString(datadogContext)
275+
version = viewEvent.version
278276
)
279277
}
280278

features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumActionScope.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import com.datadog.android.rum.internal.domain.RumContext
1818
import com.datadog.android.rum.internal.domain.Time
1919
import com.datadog.android.rum.internal.monitor.StorageEvent
2020
import com.datadog.android.rum.internal.toAction
21-
import com.datadog.android.rum.internal.utils.buildDDTagsString
2221
import com.datadog.android.rum.internal.utils.hasUserData
2322
import com.datadog.android.rum.internal.utils.newRumEventWriteOperation
2423
import com.datadog.android.rum.model.ActionEvent
@@ -351,8 +350,7 @@ internal class RumActionScope(
351350
),
352351
connectivity = networkInfo.toActionConnectivity(),
353352
service = datadogContext.service,
354-
version = datadogContext.version,
355-
ddtags = buildDDTagsString(datadogContext)
353+
version = datadogContext.version
356354
)
357355
}
358356
.apply {

features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import com.datadog.android.rum.internal.metric.networksettled.NetworkSettledMetr
2828
import com.datadog.android.rum.internal.monitor.StorageEvent
2929
import com.datadog.android.rum.internal.toError
3030
import com.datadog.android.rum.internal.toResource
31-
import com.datadog.android.rum.internal.utils.buildDDTagsString
3231
import com.datadog.android.rum.internal.utils.hasUserData
3332
import com.datadog.android.rum.internal.utils.newRumEventWriteOperation
3433
import com.datadog.android.rum.model.ErrorEvent
@@ -338,8 +337,7 @@ internal class RumResourceScope(
338337
configuration = ResourceEvent.Configuration(sessionSampleRate = sampleRate)
339338
),
340339
service = datadogContext.service,
341-
version = datadogContext.version,
342-
ddtags = buildDDTagsString(datadogContext)
340+
version = datadogContext.version
343341
)
344342
}
345343
.onError {
@@ -493,8 +491,7 @@ internal class RumResourceScope(
493491
configuration = ErrorEvent.Configuration(sessionSampleRate = sampleRate)
494492
),
495493
service = datadogContext.service,
496-
version = datadogContext.version,
497-
ddtags = buildDDTagsString(datadogContext)
494+
version = datadogContext.version
498495
)
499496
}
500497
.onError {

0 commit comments

Comments
 (0)