Configuration
Every option in sophonz-config.json and the Gradle sophonz extension, and how the collector URL and app key are set.
Configuration is split in two. sophonz-config.json decides what is captured; the Gradle sophonz block decides how the bytecode is instrumented. Both are baked into the SDK at build time and cannot be changed at runtime.
sophonz-config.json
The file lives under the app module. The first match in this order is the one used:
src/<build variant>/src/<flavor combination>/src/<individual flavor>/src/<build type>/src/main/
CAUTION — An unknown key fails the build
The parser rejects keys it does not recognise, so a single typo stops the build. Do not add keys that are not in the tables below.
The sophonz-config-schema.json at the repository root has drifted from the parser. automatic_data_capture.memory_info and session appear only in the schema and will fail the build. Treat this page as the reference.
Top level
| Key | Type | Notes |
|---|---|---|
app_id | string | Must be exactly 5 characters. Also settable via SOPHONZ_APP_ID |
api_token | string | 32 characters or more. Also settable via SOPHONZ_API_TOKEN |
ndk_enabled | boolean | Native crash capture. Default true |
sdk_config | object | See below |
app_id and api_token are used for mapping-file and NDK symbol upload. They are not the telemetry credentials. See Mapping file upload for setup.
Collector connection
{
"sdk_config": {
"ingest": {
"collector_url": "https://in.sophonz.ai",
"service_key": "app-key-replace-me",
"service_namespace": "my-project",
"deployment_environment": "production"
}
}
}| Key | Effect |
|---|---|
collector_url | Base URL of the OTLP collector. Defaults to https://in.sophonz.ai |
service_key | The app key, sent as the service.key resource attribute |
service_namespace | The service.namespace resource attribute |
deployment_environment | The deployment.environment.name resource attribute |
The SDK appends the path itself, so do not include /v1/traces in collector_url. Traces go to {collector_url}/v1/traces and logs to {collector_url}/v1/logs.
collector_url and service_key can also come from SOPHONZ_COLLECTOR_URL and SOPHONZ_SERVICE_KEY. The file wins when both are present.
NOTE — The app key is a resource attribute, not a header
OTLP requests carry no Authorization header, and there is no setting to add one. The app key travels as a resource attribute. The collector resolves the tenant from it and discards the resource when the key is missing or unregistered.
Capture toggles
| Key | Type | Default |
|---|---|---|
automatic_data_capture.power_save_mode_info | boolean | true |
automatic_data_capture.network_connectivity_info | boolean | true |
automatic_data_capture.anr_info | boolean | true |
automatic_data_capture.ui_load_tracing_disabled | boolean | false |
automatic_data_capture.ui_load_tracing_selected_only | boolean | false |
automatic_data_capture.end_startup_with_app_ready | boolean | false |
automatic_data_capture.activity_process_lifecycle_tracker_enabled | boolean | false |
view_config.enable_automatic_activity_capture | boolean | true |
taps.capture_coordinates | boolean | false |
compose.capture_compose_onclick | boolean | false |
webview.enable | boolean | true |
webview.capture_query_params | boolean | true |
webview.fragment_capture | keep, redact, remove | keep |
crash_handler.enabled | boolean | true |
app_exit_info.aei_enabled | boolean | true |
capture_fcm_pii_data | boolean | false |
app.report_disk_usage | boolean | true |
background_activity.capture_enabled | boolean | false |
sig_handler_detection | boolean | false |
otel.enable_otel_kotlin_sdk | boolean | false |
app_framework | react_native, unity, flutter, native | unset |
Network
| Key | Type | Default |
|---|---|---|
networking.enable_huc_lite_instrumentation | boolean | true |
networking.enable_native_monitoring | boolean | false |
networking.enable_traceparent_injection | boolean | false |
networking.traceparent_only_allow_domains | string[] | unset |
networking.enable_network_span_forwarding | boolean | false |
networking.capture_request_content_length | boolean | false |
networking.capture_okhttp_response_body_size | boolean | false |
networking.disabled_url_patterns | string[] (regex) | [] |
networking.default_capture_limit | int | 1000 |
networking.domains[] | {domain_name, domain_limit} | [] |
traceparent_only_allow_domains restricts which domains receive the traceparent header. The header is what joins app traces to backend traces, but narrowing the targets keeps internal trace IDs from leaking to third-party APIs outside your control.
Redaction
| Key | Type | Default |
|---|---|---|
sensitive_keys_denylist | string[] | unset |
capture_public_key | string | unset |
CAUTION — Where the schema file disagrees with the code
The repository's schema file documents taps.capture_coordinates, networking.capture_request_content_length, networking.enable_native_monitoring, and sig_handler_detection as defaulting to true. The value that actually applies when the key is omitted is false for all four, as shown above.
Gradle extension
sophonz {
bytecodeInstrumentation {
okhttpEnabled.set(true)
firebasePushNotificationsEnabled.set(true)
}
}Top-level options
| Option | Default | Description |
|---|---|---|
autoAddSophonzDependencies | true | Adds the SDK dependency automatically. Marked for removal |
autoAddSophonzComposeClickDependency | false | Adds the Compose tap instrumentation dependency |
telemetryEnabled | true | The plugin's own usage reporting |
failBuildOnUploadErrors | true | Fail the build if symbol upload fails |
customSymbolsDirectory | unset | Path to symbol files |
Bytecode instrumentation
| Option | Default | Target |
|---|---|---|
enabled | true | Master switch for all of the below |
okhttpEnabled | true | OkHttp interceptor injection |
onClickEnabled | true | View clicks |
onLongClickEnabled | true | View long-clicks |
webviewOnPageStartedEnabled | true | WebView page loads |
applicationInitTimingEnabled | true | Application init timing |
autoSdkInitializationEnabled | false | Automatic SDK start |
firebasePushNotificationsEnabled | false | FCM message receipt |
classIgnorePatterns | [] | Packages to exclude |
Turning enabled off stops all bytecode instrumentation regardless of the other values. To exclude only certain packages:
sophonz {
bytecodeInstrumentation {
classIgnorePatterns.set(listOf("com.example.vendor.*"))
}
}Per-variant control
sophonz {
buildVariantFilter {
if (name.contains("debug")) {
disablePluginForVariant()
}
}
}disableBytecodeInstrumentationForVariant() disables instrumentation but keeps the plugin. disablePluginForVariant() disables the plugin entirely for that variant.