Skip to content

feat(instrumentation): Add binder IPC call tracing#1159

Draft
markushi wants to merge 3 commits intomainfrom
markushi/feat/binder-tracing
Draft

feat(instrumentation): Add binder IPC call tracing#1159
markushi wants to merge 3 commits intomainfrom
markushi/feat/binder-tracing

Conversation

@markushi
Copy link
Copy Markdown
Member

Summary

  • Adds simple registry-based bytecode instrumentation that wraps Binder IPC calls (ContentResolver, PackageManager, Settings.*, ConnectivityManager, various system service managers, etc.) with SentryIpcTracer.onCallStart / onCallEnd calls so the SDK can emit spans/metrics for cross-process hops.
  • The matching adapter class io.sentry.android.core.SentryIpcTracer is added in feat(android): binder IPC tracing adapter for Gradle plugin instrumentation sentry-java#5326 and will ship in sentry-java 8.40.0. Instrumentation no-ops when sentry-android-core < 8.40.0 (standard SentryVersions gate).
  • New tracingInstrumentation.binderIpc.enabled extension property, defaults to true.

Test plan

  • ./gradlew :plugin-build:test --tests "io.sentry.android.gradle.instrumentation.binder.*" (9 tests, all pass)
    • BinderMethodRegistryTest — registry lookup (unknown owner, unknown method, instance, static, Context subtype coverage)
    • BinderIpcMethodVisitorTest — ASM-level visitor test: wraps known instance + static calls with tracer, emits correct component/method LDC constants, adds try/catch handler, leaves unknown calls and opcode-mismatched calls untouched
  • Full unit test suite passes
  • spotlessApply clean

Requires

🤖 Generated with Claude Code

markushi and others added 3 commits April 3, 2026 08:39
…acer adapter presence

The SentryIpcTracer adapter class is introduced in sentry-java 8.40.0
(getsentry/sentry-java#5326). Bump VERSION_BINDER_IPC so the instrumentation
no-ops when the adapter is not present on the classpath. Adds unit test
coverage for the registry lookup and the ASM visitor (tracer wrapping,
static vs instance handling, non-binder pass-through).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant