Android SDK

How the OpenTelemetry-based Android SDK is put together, what it collects, and the order to read these pages in.

The Sophonz Android SDK is built on OpenTelemetry. It captures crashes and ANRs, network requests, screen transitions, and app startup automatically, and joins them to backend spans in the same trace. The only thing the app code does is start the SDK; the Gradle plugin handles the rest at build time.

What gets installed

Three pieces work together.

ComponentRole
Gradle pluginAdds the SDK dependency, injects bytecode instrumentation, bakes the config file into the SDK
SDKCollects telemetry and exports it over OTLP
Instrumentation modulesOne module per instrumentation, split between those bundled by default and those you add

Because instrumentation is split into modules, you can leave out what you do not need and add what is not bundled. Instrumentation lists which module captures what.

Coverage

Grouped broadly, the automatic capture covers:

  • Crashes — JVM exceptions, native signals, and the exit record read on the next launch after the process died
  • Performance — the app startup trace, screen load, ANRs, thermal state
  • Network — OkHttp and HttpURLConnection requests, with bodies where configured
  • User experience — screen transitions, taps, WebView page loads
  • State — screen, network, and power timelines across the session

Defaults and switches for each are in Instrumentation.

Joining backend traces

The SDK can attach a W3C traceparent header to outgoing requests. With it, a trace that starts in the app continues into backend spans, so a slow screen can be attributed to the app or to the server from one view.

It is off by default. Turn it on with networking.enable_traceparent_injection and narrow the targets with traceparent_only_allow_domains. There is no reason to send the header to third-party APIs outside your control.

Data format

Captured data follows the OpenTelemetry semantic conventions and is exported over OTLP. No RUM-specific format is defined, so the same data can be sent to, or moved to, another OTel backend. Adding your own exporter is covered in the API reference.

Reading order

  1. Installation — applying the plugin, repository access, starting the SDK
  2. Configuration — collector URL and app key, tuning what is captured
  3. Instrumentation — what is captured and how it is classified
  4. API reference — recording your own telemetry and adding context

NOTE — Documentation for earlier versions

The v1.0, v1.1, and Vanilla SDKs distributed through the Nexus repository still have their own pages. They describe a different repository and a different API from the SDK documented here, so do not mix the two.