Skip to content

Commit b843e7e

Browse files
authored
Merge pull request #2708 from DataDog/tvaleev/feature/RUM-9899_2
[RUM-9899]: TracingInterceptor migration
2 parents f503785 + 1e8df9f commit b843e7e

File tree

330 files changed

+7900
-16838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+7900
-16838
lines changed

ci/pipelines/default-pipeline.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,23 @@ publish:release-internal:
526526
- dd-sdk-android-internal/verification-metadata.xml
527527

528528
# region Publish features/*
529+
publish:release-trace-api:
530+
tags: [ "arch:amd64" ]
531+
only:
532+
- tags
533+
- develop
534+
image: $CI_IMAGE_DOCKER
535+
stage: publish
536+
timeout: 30m
537+
script:
538+
- !reference [.snippets, set-publishing-credentials]
539+
- ./gradlew :features:dd-sdk-android-trace-api:publishToSonatype closeSonatypeStagingRepository --stacktrace --no-daemon
540+
artifacts:
541+
when: on_success
542+
expire_in: 7 days
543+
paths:
544+
- features/dd-sdk-android-trace-api/verification-metadata.xml
545+
529546

530547
publish:release-trace-internal:
531548
tags: [ "arch:amd64" ]
@@ -537,7 +554,7 @@ publish:release-trace-internal:
537554
timeout: 30m
538555
script:
539556
- !reference [ .snippets, set-publishing-credentials ]
540-
- ./gradlew :features:dd-sdk-android-trace-internal:publishToSonatype --stacktrace --no-daemon
557+
- ./gradlew :features:dd-sdk-android-trace-internal:publishToSonatype closeSonatypeStagingRepository --stacktrace --no-daemon
541558
artifacts:
542559
when: on_success
543560
expire_in: 7 days

dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/DatadogContextProvider.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ internal class DatadogContextProvider(
1717
private val coreFeature: CoreFeature,
1818
private val featureContextProvider: FeatureContextProvider
1919
) : ContextProvider {
20+
@Suppress("LongMethod")
2021
override fun getContext(withFeatureContexts: Set<String>): DatadogContext {
2122
// IMPORTANT All properties should be immutable and be frozen at the state
2223
// of the context construction moment
@@ -57,12 +58,13 @@ internal class DatadogContextProvider(
5758
architecture = architecture,
5859
numberOfDisplays = numberOfDisplays,
5960
localeInfo = with(coreFeature.androidInfoProvider) {
60-
LocaleInfo(
61-
locales = locales,
62-
currentLocale = currentLocale,
63-
timeZone = timeZone
64-
)
65-
})
61+
LocaleInfo(
62+
locales = locales,
63+
currentLocale = currentLocale,
64+
timeZone = timeZone
65+
)
66+
}
67+
)
6668
},
6769
userInfo = coreFeature.userInfoProvider.getUserInfo(),
6870
accountInfo = coreFeature.accountInfoProvider.getAccountInfo(),

dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/NoOpContextProvider.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ internal class NoOpContextProvider : ContextProvider {
5656
architecture = "",
5757
numberOfDisplays = null,
5858
localeInfo = LocaleInfo(
59-
locales = emptyList(),
60-
currentLocale = "",
61-
timeZone = ""
62-
)
59+
locales = emptyList(),
60+
currentLocale = "",
61+
timeZone = ""
62+
)
6363
),
6464
userInfo = UserInfo(null, null, null, null, emptyMap()),
6565
accountInfo = null,

detekt_custom.yml

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ datadog:
321321
- "okhttp3.Request.Builder.url(kotlin.String):java.lang.NullPointerException,java.lang.IllegalArgumentException"
322322
- "okhttp3.Request.Builder.post(okhttp3.RequestBody):java.lang.NullPointerException,java.lang.IllegalArgumentException"
323323
- "okhttp3.Request.Builder.method(kotlin.String, okhttp3.RequestBody?):java.lang.NullPointerException,java.lang.IllegalArgumentException"
324-
- "okhttp3.Request.Builder.tag(java.lang.Class, io.opentracing.Span?):java.lang.NullPointerException"
325324
- "okhttp3.Request.Builder.tag(java.lang.Class, com.datadog.android.okhttp.TraceContext?):java.lang.ClassCastException"
326325
- "okhttp3.Request.Builder.url(kotlin.String):java.lang.NullPointerException,java.lang.IllegalArgumentException"
327326
- "okhttp3.Interceptor.Chain.proceed(okhttp3.Request):java.io.IOException"
@@ -339,9 +338,6 @@ datadog:
339338
- "org.json.JSONArray.get(kotlin.Int):org.json.JSONException"
340339
- "org.json.JSONObject.get(kotlin.String):org.json.JSONException"
341340
# endregion
342-
# region OpenTracing
343-
- "io.opentracing.Scope.close():java.io.IOException"
344-
# endregion
345341
# region Gson
346342
- "com.google.gson.JsonParser.parseString(kotlin.String?):com.google.gson.JsonParseException"
347343
# endregion
@@ -759,8 +755,11 @@ datadog:
759755
- "java.util.concurrent.atomic.AtomicLong.constructor(kotlin.Long)"
760756
- "java.util.concurrent.atomic.AtomicLong.get()"
761757
- "java.util.concurrent.atomic.AtomicLong.set(kotlin.Long)"
758+
- "java.util.concurrent.atomic.AtomicReference.compareAndSet(com.datadog.trace.core.CoreTracer?, com.datadog.trace.core.CoreTracer?)"
762759
- "java.util.concurrent.atomic.AtomicReference.compareAndSet(com.datadog.android.api.SdkCore?, com.datadog.android.api.SdkCore?)"
763-
- "java.util.concurrent.atomic.AtomicReference.compareAndSet(io.opentracing.Tracer?, io.opentracing.Tracer?)"
760+
- "java.util.concurrent.atomic.AtomicReference.compareAndSet(com.datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI?, com.datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI?)"
761+
- "java.util.concurrent.atomic.AtomicReference.compareAndSet(com.datadog.android.trace.api.tracer.DatadogTracer?, com.datadog.android.trace.api.tracer.DatadogTracer?)"
762+
- "java.util.concurrent.atomic.AtomicReference.compareAndSet(UNKNOWN, UNKNOWN)"
764763
- "java.util.concurrent.atomic.AtomicReference.constructor()"
765764
- "java.util.concurrent.atomic.AtomicReference.constructor(android.app.Application.ActivityLifecycleCallbacks?)"
766765
- "java.util.concurrent.atomic.AtomicReference.constructor(com.datadog.android.api.SdkCore?)"
@@ -773,9 +772,12 @@ datadog:
773772
- "java.util.concurrent.atomic.AtomicReference.set(com.datadog.android.api.SdkCore?)"
774773
- "java.util.concurrent.atomic.AtomicReference.set(com.datadog.android.api.feature.FeatureEventReceiver?)"
775774
- "java.util.concurrent.atomic.AtomicReference.set(com.datadog.android.rum.internal.domain.RumContext?)"
776-
- "java.util.concurrent.atomic.AtomicReference.set(io.opentracing.Tracer?)"
775+
- "java.util.concurrent.atomic.AtomicReference.set(com.datadog.android.trace.api.tracer.DatadogTracer?)"
776+
- "java.util.concurrent.atomic.AtomicReference.set(com.datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI?)"
777+
- "java.util.concurrent.atomic.AtomicReference.set(com.datadog.trace.core.CoreTracer?)"
777778
- "java.util.concurrent.atomic.AtomicReference.set(kotlin.Nothing?)"
778779
- "java.util.concurrent.atomic.AtomicReference.set(kotlin.String?)"
780+
- "java.util.concurrent.atomic.AtomicReference.set(UNKNOWN)"
779781
- "java.util.concurrent.locks.ReadWriteLock.readLock()"
780782
- "java.util.concurrent.locks.ReadWriteLock.writeLock()"
781783
- "java.util.concurrent.locks.ReentrantReadWriteLock.constructor()"
@@ -853,6 +855,7 @@ datadog:
853855
- "java.util.Locale.getDefault()"
854856
- "java.util.Locale.toLanguageTag()"
855857
- "java.util.Properties.constructor()"
858+
- "java.util.Properties.contains(kotlin.Any?)"
856859
- "java.util.Properties.setProperty(kotlin.String?, kotlin.String?)"
857860
- "java.util.TimeZone.getDefault()"
858861
- "java.util.UUID.constructor(kotlin.Long, kotlin.Long)"
@@ -996,6 +999,7 @@ datadog:
996999
- "kotlin.collections.Map.forEach(kotlin.Function1)"
9971000
- "kotlin.collections.Map.forEach(kotlin.Function1)" # one of our usage is with <*, *> which doesn't get captured
9981001
- "kotlin.collections.Map.get(kotlin.String)"
1002+
- "kotlin.collections.Map.get(kotlin.String?)"
9991003
- "kotlin.collections.Map.isEmpty()"
10001004
- "kotlin.collections.Map.isNotEmpty()"
10011005
- "kotlin.collections.Map.isNullOrEmpty()"
@@ -1086,6 +1090,7 @@ datadog:
10861090
- "kotlin.collections.MutableMap.isEmpty()"
10871091
- "kotlin.collections.MutableMap.isNotEmpty()"
10881092
- "kotlin.collections.MutableMap.iterator()"
1093+
- "kotlin.collections.MutableMap.orEmpty()"
10891094
- "kotlin.collections.MutableMap.map(kotlin.Function1)"
10901095
- "kotlin.collections.MutableMap.mapValues(kotlin.Function1)"
10911096
- "kotlin.collections.MutableMap.put(kotlin.Any?, kotlin.Any?)"
@@ -1365,7 +1370,6 @@ datadog:
13651370
# region Kotlin Coroutines
13661371
- "kotlinx.coroutines.CoroutineScope.async(kotlin.coroutines.CoroutineContext, kotlinx.coroutines.CoroutineStart, kotlin.coroutines.SuspendFunction1)"
13671372
- "kotlinx.coroutines.CoroutineScope.launch(kotlin.coroutines.CoroutineContext, kotlinx.coroutines.CoroutineStart, kotlin.coroutines.SuspendFunction1)"
1368-
- "kotlinx.coroutines.CoroutineScope.withinCoroutineSpan(kotlin.String, io.opentracing.Span?, kotlin.coroutines.CoroutineContext, kotlin.coroutines.SuspendFunction1)"
13691373
- "kotlinx.coroutines.flow.FlowCollector.emit(kotlin.Any?)"
13701374
- "kotlinx.coroutines.flow.FlowCollector(kotlin.coroutines.SuspendFunction1)"
13711375
- "kotlinx.coroutines.flow.flow(kotlin.coroutines.SuspendFunction1)"
@@ -1420,7 +1424,6 @@ datadog:
14201424
- "okhttp3.Request.Builder.addHeader(kotlin.String, kotlin.String)"
14211425
- "okhttp3.Request.Builder.header(kotlin.String, kotlin.String)"
14221426
- "okhttp3.Request.Builder.removeHeader(kotlin.String)"
1423-
- "okhttp3.Request.Builder.tag(java.lang.Class, io.opentracing.Span?)"
14241427
- "okhttp3.Request.body()"
14251428
- "okhttp3.Request.header(kotlin.String)"
14261429
- "okhttp3.Request.headers()"
@@ -1443,36 +1446,13 @@ datadog:
14431446
- "org.json.JSONObject.keys()"
14441447
- "org.json.JSONObject.toJsonObject()"
14451448
# endregion
1446-
# region OpenTracing
1447-
- "io.opentracing.Span.context()"
1448-
- "io.opentracing.Span.finish()"
1449-
- "io.opentracing.Span.log(kotlin.collections.MutableMap?)"
1450-
- "io.opentracing.Span.setError(kotlin.Throwable)"
1451-
- "io.opentracing.Span.setTag(kotlin.String?, kotlin.Number?)"
1452-
- "io.opentracing.Span.setTag(kotlin.String?, kotlin.String?)"
1453-
- "io.opentracing.Span.setTag(io.opentracing.tag.Tag?, com.datadog.android.internal.concurrent.CompletableFuture?)"
1454-
- "io.opentracing.Span.setTag(io.opentracing.tag.Tag?, kotlin.String?)"
1455-
- "io.opentracing.SpanContext.toSpanId()"
1456-
- "io.opentracing.SpanContext.toTraceId()"
1457-
- "io.opentracing.Tracer.SpanBuilder.asChildOf(io.opentracing.Span?)"
1458-
- "io.opentracing.Tracer.SpanBuilder.asChildOf(io.opentracing.SpanContext?)"
1459-
- "io.opentracing.Tracer.SpanBuilder.start()"
1460-
- "io.opentracing.Tracer.activateSpan(io.opentracing.Span?)"
1461-
- "io.opentracing.Tracer.activeSpan()"
1462-
- "io.opentracing.Tracer.buildSpan(kotlin.String?)"
1463-
- "io.opentracing.Tracer.extract(io.opentracing.propagation.Format?, io.opentracing.propagation.TextMapExtract?)"
1464-
- "io.opentracing.Tracer.inject(io.opentracing.SpanContext?, io.opentracing.propagation.Format?, io.opentracing.propagation.TextMapInject?)"
1465-
- "io.opentracing.propagation.TextMapExtractAdapter.constructor(kotlin.collections.MutableMap?)"
1466-
- "io.opentracing.propagation.TextMapInject(kotlin.Function2)"
1467-
- "io.opentracing.util.GlobalTracer.get()"
1468-
- "io.opentracing.util.GlobalTracer.isRegistered()"
1469-
# endregion
14701449
# region Opentelemetry
14711450
- "io.opentelemetry.api.trace.Span.getInvalid()"
14721451
- "io.opentelemetry.api.trace.TracerBuilder.build()"
14731452
- "io.opentelemetry.api.trace.SpanBuilder.setAttribute(kotlin.String?, kotlin.String?)"
14741453
- "io.opentelemetry.api.trace.TracerBuilder.setInstrumentationVersion(kotlin.String?)"
14751454
- "io.opentelemetry.api.trace.TracerProvider.noop()"
1455+
- "io.opentelemetry.context.propagation.ContextPropagators.noop()"
14761456
- "io.opentelemetry.context.Context.get(io.opentelemetry.context.ContextKey?)"
14771457
- "io.opentelemetry.context.Context.makeCurrent()"
14781458
- "io.opentelemetry.context.Context.root()"

features/dd-sdk-android-logs/api/apiSurface

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ data class com.datadog.android.log.LogsConfiguration
3535
fun setEventMapper(com.datadog.android.event.EventMapper<com.datadog.android.log.model.LogEvent>): Builder
3636
fun build(): LogsConfiguration
3737
data class com.datadog.android.log.model.LogEvent
38-
constructor(Device, Os, Status, kotlin.String, kotlin.String, kotlin.String, Logger, Usr? = null, Account? = null, Network? = null, Error? = null, kotlin.String? = null, kotlin.String, kotlin.collections.MutableMap<kotlin.String, kotlin.Any?> = mutableMapOf())
38+
constructor(LogEventDevice, Os, Status, kotlin.String, kotlin.String, kotlin.String, Logger, Dd, Usr? = null, Account? = null, Network? = null, Error? = null, kotlin.String? = null, kotlin.String, kotlin.collections.MutableMap<kotlin.String, kotlin.Any?> = mutableMapOf())
3939
fun toJson(): com.google.gson.JsonElement
4040
companion object
4141
fun fromJson(kotlin.String): LogEvent
4242
fun fromJsonObject(com.google.gson.JsonObject): LogEvent
43-
data class Device
43+
data class LogEventDevice
4444
constructor(Type? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null, kotlin.collections.List<kotlin.String>? = null, kotlin.String? = null, kotlin.Number? = null, kotlin.Boolean? = null, kotlin.Number? = null)
4545
fun toJson(): com.google.gson.JsonElement
4646
companion object
47-
fun fromJson(kotlin.String): Device
48-
fun fromJsonObject(com.google.gson.JsonObject): Device
47+
fun fromJson(kotlin.String): LogEventDevice
48+
fun fromJsonObject(com.google.gson.JsonObject): LogEventDevice
4949
data class Os
5050
constructor(kotlin.String, kotlin.String, kotlin.String? = null, kotlin.String)
5151
fun toJson(): com.google.gson.JsonElement
@@ -58,6 +58,12 @@ data class com.datadog.android.log.model.LogEvent
5858
companion object
5959
fun fromJson(kotlin.String): Logger
6060
fun fromJsonObject(com.google.gson.JsonObject): Logger
61+
data class Dd
62+
constructor(DdDevice)
63+
fun toJson(): com.google.gson.JsonElement
64+
companion object
65+
fun fromJson(kotlin.String): Dd
66+
fun fromJsonObject(com.google.gson.JsonObject): Dd
6167
data class Usr
6268
constructor(kotlin.String? = null, kotlin.String? = null, kotlin.String? = null, kotlin.collections.MutableMap<kotlin.String, kotlin.Any?> = mutableMapOf())
6369
fun toJson(): com.google.gson.JsonElement
@@ -82,6 +88,12 @@ data class com.datadog.android.log.model.LogEvent
8288
companion object
8389
fun fromJson(kotlin.String): Error
8490
fun fromJsonObject(com.google.gson.JsonObject): Error
91+
data class DdDevice
92+
constructor(kotlin.String)
93+
fun toJson(): com.google.gson.JsonElement
94+
companion object
95+
fun fromJson(kotlin.String): DdDevice
96+
fun fromJsonObject(com.google.gson.JsonObject): DdDevice
8597
data class Client
8698
constructor(SimCarrier? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String)
8799
fun toJson(): com.google.gson.JsonElement

0 commit comments

Comments
 (0)