/agent-skills:dd-android-sdk-v3-upgradefrom agent-skills
Migrates Android apps from Datadog mobile RUM SDK v2 to v3, covering Core, RUM, Logs, Trace, OkHttp, and Session Replay breaking changes.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when an Android project uses Datadog Mobile SDK 2.x and must be upgraded to the latest stable 3.x release. The v3 migration removes legacy OpenTracing support and updates APIs across the Android SDK modules.
This skill incorporates the Android v2-to-v3 migration guidance from
DataDog/documentation, reviewed at commit
a27f7562165b9058f8cd597b48473cc7ecbeda81 on 2026-09-25. Use the instructions
below as the migration source of truth; consult the live documentation only when
the project contains an API not covered here or the requested target is newer
than this reviewed revision.
Before editing, inspect the entire Android project for:
com.datadoghq:dd-sdk-android-* dependency, including dependencies in
version catalogs, convention plugins, and included builds;com.datadog.android and io.opentracing import;useCustomEndpoint;DatadogInterceptor and TracingInterceptor construction;minSdk and Kotlin version.Do not remove a Datadog feature, instrumentation path, or test merely to make the upgrade compile. Preserve the application's existing telemetry behavior.
minSdk to 23, stop and report that it cannot adopt SDK v3.composeOptions.kotlinCompilerExtensionVersion together using the official
Compose-to-Kotlin compatibility map. Do not suppress
the compatibility check.minSdk below
26, enable core-library desugaring as required by OpenTelemetry Java.Before editing dependencies, query the official
DataDog/dd-sdk-android GitHub releases and select the
highest stable semantic version matching 3.x.y. Ignore drafts, prereleases,
release candidates, -SNAPSHOT versions, and releases from other major
versions. The GitHub Releases API can be queried at:
https://api.github.com/repos/DataDog/dd-sdk-android/releases?per_page=100
Use each release object's tag_name, draft, and prerelease fields rather
than assuming the first tag or the repository's development changelog is a
stable release. If GitHub cannot be reached or the response cannot be parsed,
use 3.14.1 as the fallback version and report that fallback explicitly.
Change every Datadog Android SDK artifact from 2.x to the selected concrete 3.x version. Follow the project's existing version-management convention and update the lockfile or version catalog where applicable.
Do not introduce moving versions such as 3.+ or latest.release, and do not
leave a mixture of v2 and v3 Datadog artifacts in the resolved dependency graph.
If the application uses Jetpack Compose and enables Compose instrumentation in the Datadog Gradle plugin, add the v3 Compose integration at the same SDK version:
implementation("com.datadoghq:dd-sdk-android-compose:<datadog-v3-version>")
Leaving Compose instrumentation enabled without this artifact causes the Datadog compiler plugin to fail compilation with a missing-dependency error.
The user ID passed to Datadog.setUserInfo is mandatory in v3. Replace null
with the application's stable user identifier:
// v2
Datadog.setUserInfo(null, "Jane Smith", "[email protected]")
// v3
Datadog.setUserInfo("user123", "Jane Smith", "[email protected]")
Do not invent a production identity value. Reuse the application's actual user identifier or preserve its existing anonymous-user strategy with an appropriate non-null identifier.
RumConfiguration.Builder.useCustomEndpoint must receive the complete RUM
upload URL rather than only a host:
Rum.enable(
RumConfiguration.Builder("<application-id>")
.useCustomEndpoint("https://example.com/rum/upload")
.build()
)
Preserve the project's custom host and path.
Replace the string HTTP method argument of startResource with
RumResourceMethod:
import com.datadog.android.rum.RumResourceMethod
GlobalRumMonitor.get().startResource(
key = "resource-key",
method = RumResourceMethod.GET,
url = "https://example.com/api/resource",
attributes = mapOf("source" to "manual")
)
Use the enum member corresponding to the original method; do not default every
resource to GET.
Update the global RUM symbol:
| v2 | v3 |
|---|---|
com.datadog.android.rum.GlobalRum | com.datadog.android.rum.GlobalRumMonitor |
Use GlobalRumMonitor.get() to access the registered monitor. Do not replace it
with RumMonitor.get(); RumMonitor does not provide that v3 accessor.
In v3, the attributes: Map<String, Any?> parameter is optional for these APIs:
RumMonitor.addActionRumMonitor.startActionRumMonitor.stopResourceRumMonitor.addErrorRumMonitor.addErrorWithStacktraceAdvancedNetworkRumMonitor.stopResourceExisting attribute maps remain valid. Remove redundant empty maps only when it improves the migrated code without changing behavior.
Logs no longer reports fatal errors on its own. If the existing application expects crashes to appear in Error Tracking, keep RUM enabled and enable Crash Reporting explicitly in addition to Logs.
LogsConfiguration.Builder.useCustomEndpoint must receive the complete Logs
upload URL:
Logs.enable(
LogsConfiguration.Builder()
.useCustomEndpoint("https://example.com/logs/upload")
.build()
)
Preserve all products that were enabled before the migration. In particular,
do not remove Rum.enable(...) or Logs.enable(...) to resolve compilation
failures.
TraceConfiguration.Builder.useCustomEndpoint must receive the complete Trace
upload URL:
Trace.enable(
TraceConfiguration.Builder()
.useCustomEndpoint("https://example.com/trace/upload")
.build()
)
SDK v3 removes OpenTracing. Choose one of the following migrations based on the project's constraints.
Add the v3 OpenTelemetry bridge using the same SDK version as the other Datadog artifacts:
implementation("com.datadoghq:dd-sdk-android-trace-otel:<datadog-v3-version>")
For the simple case, replace global tracer registration:
// v2 OpenTracing
GlobalTracer.registerIfAbsent(
AndroidTracer.Builder()
.setService(BuildConfig.APPLICATION_ID)
.build()
)
// v3 OpenTelemetry
GlobalOpenTelemetry.set(
DatadogOpenTelemetry(BuildConfig.APPLICATION_ID)
)
DatadogOpenTelemetry is a convenience wrapper. Its constructor accepts only
the service name; do not pass an SdkCore to it. When the v2 tracer has custom
builder configuration, such as an SDK instance or partial-flush threshold,
build the provider directly instead:
val tracerProvider = OtelTracerProvider.Builder(sdkCore)
.setService(BuildConfig.APPLICATION_ID)
.setPartialFlushThreshold(4)
.build()
GlobalOpenTelemetry.set(object : OpenTelemetry {
override fun getTracerProvider(): TracerProvider = tracerProvider
override fun getPropagators(): ContextPropagators = ContextPropagators.noop()
})
val tracer = tracerProvider.get("SampleApplicationTracer")
OtelTracerProvider.Builder(...).build() returns a TracerProvider, not an
OpenTelemetry instance. Do not pass the provider directly to
GlobalOpenTelemetry.set(...); wrap it as shown above.
setPartialFlushThreshold belongs to OtelTracerProvider.Builder, not to the
built OtelTracerProvider. Configure it before calling build(); do not cast
openTelemetry.tracerProvider and attempt to mutate it afterward.
Replace manual tracing with the OpenTelemetry API:
val tracer: Tracer = GlobalOpenTelemetry
.get()
.getTracer("SampleApplicationTracer")
val span = tracer
.spanBuilder("Executing operation")
.startSpan()
// Instrumented operation
span.end()
Apply these type and API mappings:
| v2 OpenTracing | v3 OpenTelemetry |
|---|---|
io.opentracing.util.GlobalTracer | io.opentelemetry.api.GlobalOpenTelemetry |
com.datadog.android.trace.AndroidTracer | io.opentelemetry.api.trace.Tracer |
io.opentracing.Span | io.opentelemetry.api.trace.Span |
io.opentracing.Scope | io.opentelemetry.context.Scope |
io.opentracing.SpanContext | io.opentelemetry.api.trace.SpanContext |
AndroidTracer.Builder(...).setPartialFlushThreshold(Int) | OtelTracerProvider.Builder(...).setPartialFlushThreshold(Int) |
SpanContext.toTraceId() | SpanContext.traceId (Kotlin) / SpanContext.getTraceId() (Java) |
Span.setError() | Span.recordException() |
Use this path only when the project cannot enable the desugaring required by OpenTelemetry. It exists to ease migration and may be removed in a future major SDK version.
Replace global tracer registration:
// v2 OpenTracing
GlobalTracer.registerIfAbsent(
AndroidTracer.Builder()
.setService(BuildConfig.APPLICATION_ID)
.build()
)
// v3 Datadog tracing API
GlobalDatadogTracer.registerIfAbsent(
DatadogTracing.newTracerBuilder(sdkCore)
.withServiceName(BuildConfig.APPLICATION_ID)
.withPartialFlushMinSpans(4)
.build()
)
Replace manual tracing:
val tracer = GlobalDatadogTracer.get()
val span = tracer
.buildSpan("Executing operation")
.start()
val scope = tracer.activateSpan(span)
try {
// Instrumented operation
val traceId = span.context().traceId.toString()
} finally {
scope?.close()
span.finish()
}
DatadogTracer.activateSpan() returns a nullable DatadogScope; close it with
scope?.close().
DatadogSpan.context() is a function, not a Kotlin property. Call it with
parentheses: use span.context().traceId, not span.context.traceId.
Apply these type and API mappings:
| v2 OpenTracing | v3 Datadog tracing API |
|---|---|
io.opentracing.util.GlobalTracer | com.datadog.android.trace.GlobalDatadogTracer |
com.datadog.android.trace.AndroidTracer | com.datadog.android.trace.api.tracer.DatadogTracer |
io.opentracing.Span | com.datadog.android.trace.api.span.DatadogSpan |
io.opentracing.Scope | com.datadog.android.trace.api.scope.DatadogScope |
io.opentracing.SpanContext | com.datadog.android.trace.api.span.DatadogSpanContext |
AndroidTracer.Builder().build() | DatadogTracing.newTracerBuilder().build() |
AndroidTracer.Builder(...).setService(String) | DatadogTracerBuilder.withServiceName(String) |
AndroidTracer.Builder(...).setPartialFlushThreshold(Int) | DatadogTracerBuilder.withPartialFlushMinSpans(Int) |
SpanContext.toTraceId() | DatadogSpanContext.traceId.toString() |
Span.setError() | DatadogSpan.addThrowable() |
After either path, verify that no source or dependency still relies on
io.opentracing.
The com.datadoghq:dd-sdk-android-okhttp artifact itself does not require
desugaring. Replace the removed positional constructors with builders while
preserving service names, traced hosts and header types, listeners, resource
attribute providers, and samplers.
| Removed v2 constructor family | v3 replacement |
|---|---|
TracingInterceptor(...) | TracingInterceptor.Builder(tracedHosts) |
DatadogInterceptor(...) | DatadogInterceptor.Builder(tracedHosts) |
Search every overload, including constructors that accept any combination of:
List<String> traced hosts;Map<String, Set<TracingHeaderType>> traced-host configuration;TracedRequestListener;RumResourceAttributesProvider;Sampler<Span>.The builder requires either List<String> or
Map<String, Set<TracingHeaderType>> in its constructor. There is no
zero-argument builder and no setTracedHostsWithHeaderType method. Do not drop
constructor arguments during the conversion; map each behavior to the
corresponding builder option:
val datadogInterceptor = DatadogInterceptor.Builder(tracedHostsWithHeaderType)
.setSdkInstanceName(sdkCore.name)
.setTracedRequestListener(tracedRequestListener)
.setRumResourceAttributesProvider(resourceAttributesProvider)
.setTraceSampler(DeterministicTraceSampler(20f))
.build()
val tracingInterceptor = TracingInterceptor.Builder(tracedHostsWithHeaderType)
.setSdkInstanceName(sdkCore.name)
.setTracedRequestListener(tracedRequestListener)
.setTraceSampler(DeterministicTraceSampler(20f))
.build()
In v3, TracedRequestListener receives a Datadog span, even when the
application's manual tracing uses OpenTelemetry:
val tracedRequestListener = object : TracedRequestListener {
override fun onRequestIntercepted(
request: Request,
span: DatadogSpan,
response: Response?,
throwable: Throwable?
) {
span.setTag("request.method", request.method)
}
}
Update custom samplers from Sampler<io.opentracing.Span> to
Sampler<DatadogSpan>.
SessionReplayConfiguration.Builder.useCustomEndpoint must receive the full
Session Replay upload URL:
SessionReplay.enable(
SessionReplayConfiguration.Builder(...)
.useCustomEndpoint("https://example.com/session_replay/upload")
.build()
)
Preserve the application's existing Session Replay privacy and sampling configuration.
Run the project's normal Gradle compilation task. Prefer the same compilation command used by the project's CI.
Before finishing, confirm:
com.datadoghq:dd-sdk-android-* artifacts are on one stable 3.x
version;minSdk is at least 23 and Kotlin is at least 1.9;io.opentracing dependency or import remains;RumResourceMethod;GlobalRumMonitor.get();Fix only migration-related failures. Do not rewrite unrelated application code or remove instrumentation to obtain a successful compilation.
Report the original and resulting SDK versions, the migration path chosen for tracing, the files changed, and the exact Gradle compilation command that passed.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
datadog, android-sdk, rum, sdk-migration, session-replay, opentracing
78 skills in this plugin
/agent-observability-auto-experimentRun an iterative code-improvement hill-climb against real Datadog LLM-Obs data, locally, with Claude Code as the agent. Establishes a baseline eval, makes one focused change, re-scores both splits with the same harness, keeps the change when held-out test improves without overfitting val (labeling within-noise gains tentative), and repeats. This is the skill published as "Autoresearch" in Datadog Agent Observability. Use when the user says "run an auto experiment", "run autoresearch", "hill-climb this code", "iteratively improve X and measure the delta", "optimize this code/agent/pipeline/prompt against my traces", "auto-optimize against LLM-Obs", or wants the local equivalent of the auto_experiments worker. Works from an ml_app, a dataset_id, an annotation_queue_id (a queue of human-labelled interactions), a list of trace_ids, or (by exception) a local dataset file. The corpus and its val/test splits live in Datadog LLM-Obs Datasets, created once per run with a timestamp in their names./agent-observability-build-eval-from-annotationsFit a Datadog LLM-Obs evaluator to human labels. Takes an annotation queue, works out where in the trace the labelled property actually lives, drafts an LLM-judge that predicts the human label, scores that judge against the already-labelled rows with a metric agreed with the user, then hill-climbs it — inspect the errors, make one focused change, re-score, keep it only if it beats the best — for a bounded number of iterations, and finally publishes the winner to Datadog as a DISABLED evaluator (not a Datadog draft — a real evaluator with `enabled: false`). Use when the user says "build an eval from my annotations", "build an evaluator from the annotation queue", "turn my annotations into an evaluator", "learn an evaluator from my labels", "fit a judge to the annotation queue", "auto-label", "auto labelling", "automate this annotation queue", "scale up my human labels", or wants the rest of a queue graded the way the humans graded the first rows. Needs an annotation queue with at least two classes present in the human labels (e.g. one true and one false for a boolean)./agent-observability-eval-bootstrapBootstrap evaluators from production traces — by default propose online LLM-judge evaluators and, after you confirm, create them in Datadog as disabled drafts (never auto-enabled); on request emit Python SDK code or a framework-agnostic JSON spec instead. Use when user says "bootstrap evaluators", "generate evaluators", "create evals from traces", "eval bootstrap", "write evaluators", "build eval suite", "publish evaluators", or wants to generate BaseEvaluator/LLMJudge code or online judge configs from production LLM trace data. Works with ml_app and optional RCA report or failure hypothesis./agent-observability-eval-pipelineEnd-to-end Agent Observability pipeline for an instrumented ml_app — classify production traces, root-cause failures, bootstrap evaluators, then (optionally) sample + publish a dataset, generate + run an experiment, and analyze results. Six narrated phases with a standardized banner and a "continue" checkpoint between each. Pure orchestration over the agent-observability sub-skills (`agent-observability-session-classify`, `agent-observability-trace-rca`, `agent-observability-eval-bootstrap`, `agent-observability-experiment-bootstrap`, `agent-observability-experiment-analyzer`). Use when user says "run the eval pipeline", "go from traces to evals", "bootstrap evals end to end", "classify then RCA then bootstrap", "build an eval set from scratch", "onboard me to datasets and experiments", "walk me through experiments", "I have an ml_app, now what", "Agent Observability onboarding", "guided experiment setup", "from traces to experiments", or wants a deterministic, narrated tour from production data through evaluators, datasets, and experiments. Stop early with `--stop-after <phase>` to short-circuit at evaluators or dataset, or resume mid-flow with `--start-at <phase>`./agent-observability-experiment-analyzerAnalyze LLM experiment results. Handles single or comparative experiments, exploratory or Q&A modes. Use when user says "analyze experiment", "compare experiments", "analyze against baseline", or provides one or two experiment IDs for analysis./agent-observability-experiment-bootstrapBootstrap a reproducible LLM Observability experiment through the Python ddtrace SDK or the Node dd-trace SDK. Use for experiment, dataset, evaluator, benchmark, regression, or LLM-as-a-judge scaffolding. The legacy Python invocation remains supported.npx claudepluginhub datadog-labs/agent-skills --plugin agent-skillsOther plugins' skills for the same job