설정
sophonz-config.json의 전체 항목과 Gradle sophonz 확장 블록의 옵션, 수집기 주소와 앱 키를 지정하는 방법을 정리합니다.
설정은 두 곳에 나뉘어 있습니다. 무엇을 수집할지는 sophonz-config.json이, 바이트코드를 어떻게 손댈지는 Gradle의 sophonz 블록이 정합니다. 둘 다 빌드 시점에 SDK에 새겨지므로 런타임에 바꿀 수 없습니다.
sophonz-config.json
앱 모듈 아래에 둡니다. 다음 순서로 찾아 처음 발견한 파일 하나만 사용합니다.
src/<빌드 배리언트>/src/<플레이버 조합>/src/<개별 플레이버>/src/<빌드 타입>/src/main/
CAUTION — 모르는 키는 빌드를 실패시킵니다
파서는 알 수 없는 키를 만나면 오류를 냅니다. 오타 하나로 빌드가 멈추므로, 아래 표에 없는 키는 넣지 마세요.
저장소 루트의 sophonz-config-schema.json은 실제 파서와 어긋나 있습니다. 스키마에만 있는 automatic_data_capture.memory_info와 session을 넣으면 빌드가 실패합니다. 이 문서의 표를 기준으로 삼으세요.
최상위
| 키 | 타입 | 설명 |
|---|---|---|
app_id | string | 5자여야 합니다. 환경 변수 SOPHONZ_APP_ID로도 지정 |
api_token | string | 32자 이상이어야 합니다. 환경 변수 SOPHONZ_API_TOKEN으로도 지정 |
ndk_enabled | boolean | 네이티브 크래시 수집. 기본값 true |
sdk_config | object | 아래 항목 |
app_id와 api_token은 매핑 파일과 NDK 심볼 업로드에 쓰입니다. 텔레메트리 전송용 자격 증명이 아닙니다.
수집기 연결
{
"sdk_config": {
"ingest": {
"collector_url": "https://in.sophonz.ai",
"service_key": "app-key-replace-me",
"service_namespace": "my-project",
"deployment_environment": "production"
}
}
}| 키 | 효과 |
|---|---|
collector_url | OTLP 수집기 기본 주소. 생략하면 https://in.sophonz.ai |
service_key | 앱 키. service.key 리소스 속성으로 전송 |
service_namespace | service.namespace 리소스 속성 |
deployment_environment | deployment.environment.name 리소스 속성 |
경로는 SDK가 붙입니다. collector_url에 /v1/traces까지 적지 마세요. 트레이스는 {collector_url}/v1/traces로, 로그는 {collector_url}/v1/logs로 전송됩니다.
collector_url과 service_key는 각각 SOPHONZ_COLLECTOR_URL, SOPHONZ_SERVICE_KEY 환경 변수로도 지정할 수 있습니다. 파일에 값이 있으면 파일이 우선합니다.
NOTE — 앱 키는 헤더가 아니라 리소스 속성입니다
OTLP 요청에 Authorization 헤더가 없고, 헤더를 추가하는 설정도 없습니다. 앱 키는 리소스 속성으로 전송됩니다. 수집기는 이 값으로 테넌트를 판별하며, 값이 없거나 등록되지 않은 키면 해당 리소스를 버립니다.
수집 항목
| 키 | 타입 | 기본값 |
|---|---|---|
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 | 없음 |
네트워크
| 키 | 타입 | 기본값 |
|---|---|---|
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[] | 없음 |
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[] (정규식) | [] |
networking.default_capture_limit | int | 1000 |
networking.domains[] | {domain_name, domain_limit} | [] |
traceparent_only_allow_domains는 traceparent 헤더를 붙일 도메인을 제한합니다. 백엔드와 트레이스를 연결하려면 이 헤더가 필요하지만, 통제 범위 밖의 서드파티 API로 내부 트레이스 ID가 새어 나가지 않도록 대상을 좁히는 것이 안전합니다.
민감정보
| 키 | 타입 | 기본값 |
|---|---|---|
sensitive_keys_denylist | string[] | 없음 |
capture_public_key | string | 없음 |
CAUTION — 문서화된 기본값과 코드가 다른 항목
저장소의 스키마 파일은 taps.capture_coordinates, networking.capture_request_content_length, networking.enable_native_monitoring, sig_handler_detection의 기본값을 true로 적고 있으나, 키를 생략했을 때 실제로 적용되는 값은 위 표대로 모두 false입니다.
Gradle 확장
sophonz {
bytecodeInstrumentation {
okhttpEnabled.set(true)
firebasePushNotificationsEnabled.set(true)
}
}최상위 옵션
| 옵션 | 기본값 | 설명 |
|---|---|---|
autoAddSophonzDependencies | true | SDK 의존성 자동 추가. 제거 예정 |
autoAddSophonzComposeClickDependency | false | Compose 탭 계측 의존성 자동 추가 |
telemetryEnabled | true | 플러그인 자체의 사용 통계 전송 |
failBuildOnUploadErrors | true | 심볼 업로드 실패 시 빌드 중단 |
customSymbolsDirectory | 없음 | 심볼 파일 경로 지정 |
바이트코드 계측
| 옵션 | 기본값 | 대상 |
|---|---|---|
enabled | true | 전체 마스터 스위치 |
okhttpEnabled | true | OkHttp 인터셉터 삽입 |
onClickEnabled | true | View 클릭 |
onLongClickEnabled | true | View 롱클릭 |
webviewOnPageStartedEnabled | true | WebView 페이지 로드 |
applicationInitTimingEnabled | true | Application 초기화 시간 측정 |
autoSdkInitializationEnabled | false | SDK 자동 시작 |
firebasePushNotificationsEnabled | false | FCM 메시지 수신 |
classIgnorePatterns | [] | 제외할 패키지 패턴 |
enabled를 끄면 나머지 값과 무관하게 바이트코드 계측이 모두 멈춥니다. 특정 패키지만 제외하려면 다음과 같이 지정합니다.
sophonz {
bytecodeInstrumentation {
classIgnorePatterns.set(listOf("com.example.vendor.*"))
}
}배리언트별 제어
sophonz {
buildVariantFilter {
if (name.contains("debug")) {
disablePluginForVariant()
}
}
}disableBytecodeInstrumentationForVariant()는 계측만 끄고 플러그인은 유지합니다. disablePluginForVariant()는 해당 배리언트에서 플러그인 전체를 비활성화합니다.