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:

  1. src/<build variant>/
  2. src/<flavor combination>/
  3. src/<individual flavor>/
  4. src/<build type>/
  5. 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

KeyTypeNotes
app_idstringMust be exactly 5 characters. Also settable via SOPHONZ_APP_ID
api_tokenstring32 characters or more. Also settable via SOPHONZ_API_TOKEN
ndk_enabledbooleanNative crash capture. Default true
sdk_configobjectSee 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"
    }
  }
}
KeyEffect
collector_urlBase URL of the OTLP collector. Defaults to https://in.sophonz.ai
service_keyThe app key, sent as the service.key resource attribute
service_namespaceThe service.namespace resource attribute
deployment_environmentThe 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

KeyTypeDefault
automatic_data_capture.power_save_mode_infobooleantrue
automatic_data_capture.network_connectivity_infobooleantrue
automatic_data_capture.anr_infobooleantrue
automatic_data_capture.ui_load_tracing_disabledbooleanfalse
automatic_data_capture.ui_load_tracing_selected_onlybooleanfalse
automatic_data_capture.end_startup_with_app_readybooleanfalse
automatic_data_capture.activity_process_lifecycle_tracker_enabledbooleanfalse
view_config.enable_automatic_activity_capturebooleantrue
taps.capture_coordinatesbooleanfalse
compose.capture_compose_onclickbooleanfalse
webview.enablebooleantrue
webview.capture_query_paramsbooleantrue
webview.fragment_capturekeep, redact, removekeep
crash_handler.enabledbooleantrue
app_exit_info.aei_enabledbooleantrue
capture_fcm_pii_databooleanfalse
app.report_disk_usagebooleantrue
background_activity.capture_enabledbooleanfalse
sig_handler_detectionbooleanfalse
otel.enable_otel_kotlin_sdkbooleanfalse
app_frameworkreact_native, unity, flutter, nativeunset

Network

KeyTypeDefault
networking.enable_huc_lite_instrumentationbooleantrue
networking.enable_native_monitoringbooleanfalse
networking.enable_traceparent_injectionbooleanfalse
networking.traceparent_only_allow_domainsstring[]unset
networking.enable_network_span_forwardingbooleanfalse
networking.capture_request_content_lengthbooleanfalse
networking.capture_okhttp_response_body_sizebooleanfalse
networking.disabled_url_patternsstring[] (regex)[]
networking.default_capture_limitint1000
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

KeyTypeDefault
sensitive_keys_denyliststring[]unset
capture_public_keystringunset

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

app/build.gradle.kts
sophonz {
  bytecodeInstrumentation {
    okhttpEnabled.set(true)
    firebasePushNotificationsEnabled.set(true)
  }
}

Top-level options

OptionDefaultDescription
autoAddSophonzDependenciestrueAdds the SDK dependency automatically. Marked for removal
autoAddSophonzComposeClickDependencyfalseAdds the Compose tap instrumentation dependency
telemetryEnabledtrueThe plugin's own usage reporting
failBuildOnUploadErrorstrueFail the build if symbol upload fails
customSymbolsDirectoryunsetPath to symbol files

Bytecode instrumentation

OptionDefaultTarget
enabledtrueMaster switch for all of the below
okhttpEnabledtrueOkHttp interceptor injection
onClickEnabledtrueView clicks
onLongClickEnabledtrueView long-clicks
webviewOnPageStartedEnabledtrueWebView page loads
applicationInitTimingEnabledtrueApplication init timing
autoSdkInitializationEnabledfalseAutomatic SDK start
firebasePushNotificationsEnabledfalseFCM 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.