[RUM-9899]: TracingInterceptor migration#2708
Conversation
mariusc83
left a comment
There was a problem hiding this comment.
LGTM in general. We're missing the part where we are able to inject our own tracer into the DatadogInterceptor#builder, see the Slack thread but I guess this can still be added into this PR.
caa0454 to
253eace
Compare
186412e to
4897596
Compare
… resolution during one of last commit squashing procedure
…xtension implementations
…eTracer and related classes for customers. The only publicity available ways for tracing feature usage: - okhttp instrumentation - manual instrumentation with Otel so it's okay that TracerContext is the only way to set the parent span (otherwise AgentSpan will be exposed)
|
lgtm but better wait also for @mariusc83 approval |
… to meta, reverting _dd object back to log
c33379f to
c32340a
Compare
| fun build(): LogsConfiguration | ||
| data class com.datadog.android.log.model.LogEvent | ||
| 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()) | ||
| 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()) |
There was a problem hiding this comment.
it seems these changes should already be in v3, is develop only merged in the tracing branch?
There was a problem hiding this comment.
This change appears because we have to revert os and device back to meta in this commit. The change was made in this branch, but not in separate ticket to speed up next dogfooding interation
| # Required because we need access to GlobalTracer isRegistered property to reset it through reflection | ||
| -keepnames class io.opentracing.util.GlobalTracer { | ||
| private boolean isRegistered; | ||
| # Required because we need access to GlobalDatadogTracer getOrNull method to reset it through reflection |
There was a problem hiding this comment.
this is already declared in the trace module, so I guess re-declaration is not needed?
There was a problem hiding this comment.
Not tested yet, gonna remove in separate ticket RUM-11362 (after we make a decision regarding publicitly available DatadogTracer)
There was a problem hiding this comment.
What I mean here is that it is already declared in the Proguard rules file of the Tracing module and so will be added from there.
fun activateSpan(span: DatadogSpan, asyncPropagating: Boolean): DatadogScope? internal
| /** | ||
| * Represents the duration of a span in nanoseconds. | ||
| */ | ||
| val durationNano: Long | ||
|
|
||
| /** | ||
| * Represents the start time of the span in nanoseconds. | ||
| */ | ||
| val startTimeNanos: Long |
There was a problem hiding this comment.
minor: it is better to have consistent naming, so it should be durationNanos
There was a problem hiding this comment.
Gonna address this in next PR if possible
| fun get(): com.datadog.android.trace.api.tracer.DatadogTracer | ||
| fun getOrNull(): com.datadog.android.trace.api.tracer.DatadogTracer? |
There was a problem hiding this comment.
do we need both? maybe we should leave only one of them?
There was a problem hiding this comment.
Gonna address this in next PR if possible
1cdef63 to
1e8df9f
Compare
What does this PR do?
This PR contains major change for tracer migration.
I tried to reduce amount of changes with some tricks with kotlin's
typealiasbut it still huge. Maybe some of you will find it easier to review by commits.Main changes:
AndroidTracertoCoreTracerinTracingInterceptorand it descendants.Please pay attention to:
Despite the fact that the APIs of CoreTracer and AndroidTracer are similar, some methods were either not supported or supported at a different level of abstraction. In such cases, I implemented the closest and simplest solution and added comments so you could spot them.
Known issues
GlobalTracer, butTracingInterceptorrelies on some globally storedCoreTracerinstance. Going to discuss this with the team and provide solution with separate PR.Review checklist (to be filled by reviewers)