Instrumentation
What each built-in Android instrumentation captures, the spz.type it attaches, whether it is on by default, and how to turn it on or off.
The Android SDK splits instrumentation into modules. Each one wraps a single Android API or framework and attaches a spz.type attribute to the telemetry it produces. Dashboards and the session timeline classify data by that value, so which type an instrumentation uses is also what you query on.
The type scheme
spz.type takes the form type.subtype. There are four top-level types.
| Type | Meaning | Applies to |
|---|---|---|
perf | How long an interval took | Spans |
ux | User behaviour or something visible on screen | Spans, logs, span events |
sys | System events not tied to user behaviour | Spans, logs, span events |
state | A value that changes over the session | State timelines |
Performance
| Instrumentation | spz.type | Default | Switch | Also needs |
|---|---|---|---|---|
| App startup trace | perf | On | — | — |
| Screen load | perf.ui_load | On | automatic_data_capture.ui_load_tracing_disabled | — |
| ANR (thread blockage) | perf.thread_blockage | On | automatic_data_capture.anr_info | — |
| Thermal state | perf.thermal_state | On | Remote config | API 29+ |
| Frame smoothness | perf.smoothness | Off | Remote config | API 24+ |
| Screen load detail | perf.screen_load | Off | Remote config | API 24+ |
| OkHttp | perf.network_request | On | Bytecode okhttpEnabled | OkHttp |
| HttpURLConnection (lite) | perf.network_request | On | networking.enable_huc_lite_instrumentation | — |
| HttpURLConnection (full) | perf.network_request | Off | networking.enable_native_monitoring | Separate artifact |
The startup trace builds a tree of process-init, sophonz-init, activity-init, and app-ready. You can add your own child spans and attributes with addStartupTraceChildSpan and addStartupTraceAttribute.
The two HttpURLConnection instrumentations do not run together: enabling the full one stands the lite one down.
User experience
| Instrumentation | spz.type | Default | Switch | Also needs |
|---|---|---|---|---|
| Screen (Activity) | ux.view | On | view_config.enable_automatic_activity_capture | — |
| Tap (View) | ux.tap | On | Bytecode onClickEnabled, onLongClickEnabled | — |
| Tap (Compose) | ux.tap | Off | compose.capture_compose_onclick | Compose, separate artifact |
| WebView | ux.webview | On | webview.enable plus bytecode webviewOnPageStartedEnabled | — |
Tap coordinates are captured only with taps.capture_coordinates, which is off by default. Compose taps identify elements by test tag, so an element without one is recorded unnamed.
WebView records the URL at onPageStarted. Query parameters are controlled by webview.capture_query_params and the fragment by webview.fragment_capture (keep, redact, remove).
System
| Instrumentation | spz.type | Default | Switch | Also needs |
|---|---|---|---|---|
| JVM crash | sys.android.crash | On | crash_handler.enabled | — |
| Native crash | sys.android.native_crash | On | ndk_enabled | NDK |
| App exit info | sys.exit | On | app_exit_info.aei_enabled | API 30+ |
| Push notification (FCM) | sys.push_notification | Off | Bytecode firebasePushNotificationsEnabled | Firebase Messaging |
| Power save mode | sys.low_power | On | automatic_data_capture.power_save_mode_info | — |
| Connectivity change | sys.network_status | On | automatic_data_capture.network_connectivity_info | — |
| Request and response bodies | sys.network_capture | Per remote rule | — | — |
App exit info carries Android's own ApplicationExitInfo records: exit reason, importance, memory usage, and any ANR or native trace. It is read on the next launch after the process has already died, which is how it covers the terminations crash instrumentation cannot see.
The FCM module is bundled but captures nothing unless the bytecode instrumentation is enabled. Personal data such as the title and body is included only with capture_fcm_pii_data.
Body capture applies only to requests matching a remote rule. Local configuration alone does not enable it.
State timelines
Values that change while a session runs. They are recorded as intervals rather than spans, so they can be overlaid on other telemetry in the session timeline.
| State | Values | Default |
|---|---|---|
| Screen | Current screen name | On |
| Network | wifi, wan, not_reachable, and so on | On |
| Power | Whether power-save mode is active | On |
Screen state is recorded from Activity transitions alone, but an app using Jetpack Navigation needs the androidx-navigation integration for per-destination accuracy.
Instrumentation that produces no telemetry
Memory leak detection emits neither spans nor logs. It records a session attribute listing Activity and Fragment instances that were not reclaimed. It is off by default and can only be enabled through remote config. It requires API 23+, and Fragment coverage additionally requires androidx.fragment.
Additional instrumentation
These are not bundled with the SDK. Add the artifact when you need them.
| Artifact | Role |
|---|---|
sophonz-android-instrumentation-androidx-navigation | Feeds Jetpack Navigation destination changes into screen state |
sophonz-android-instrumentation-compose-tap | Captures taps on Compose elements |
sophonz-android-instrumentation-huc | Full HttpURLConnection instrumentation |
androidx-navigation is wired per screen with rememberObservedNavController or rememberObservedBackStack. It does not apply automatically.
NOTE — Items decided by remote config
Rows whose switch reads "remote config" cannot be enabled from sophonz-config.json. The server-supplied configuration decides them, and the default in the table is the value used when no remote config is present.
Turning it all off
This disables every bytecode instrumentation at once.
sophonz {
bytecodeInstrumentation {
enabled.set(false)
}
}To exclude only certain packages, use classIgnorePatterns — see Configuration.