Skip to content

feat(android): Add binder (IPC) tracing and logging instrumentation#5515

Draft
markushi wants to merge 2 commits into
mainfrom
feat/android-binder-tracing
Draft

feat(android): Add binder (IPC) tracing and logging instrumentation#5515
markushi wants to merge 2 commits into
mainfrom
feat/android-binder-tracing

Conversation

@markushi
Copy link
Copy Markdown
Member

@markushi markushi commented Jun 8, 2026

📜 Description

Adds an internal SentryBinderAdapter that hooks into Android binder (IPC) calls, together with two new opt-in SentryAndroidOptions:

  • enableBinderTracing (io.sentry.traces.binder.enable) — creates child spans on the active transaction for binder calls, annotated with thread id/name.
  • enableBinderLogging (io.sentry.logs.binder.enable) — emits a Sentry log entry for each binder call.

Both options default to false and can also be configured via AndroidManifest.xml metadata. The adapter is wired up during SentryAndroid.init and is designed to never crash the host app (all instrumentation is wrapped in defensive try/catch).

💡 Motivation and Context

Binder (IPC) calls can be a significant and hard-to-diagnose source of latency on Android. Surfacing them as spans and/or logs gives developers visibility into IPC activity happening on their threads.

💚 How did you test it?

Added unit tests for SentryBinderAdapter, the new SentryAndroidOptions getters/setters, and ManifestMetadataReader parsing of the new manifest attributes.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against bdaa739

@sentry
Copy link
Copy Markdown

sentry Bot commented Jun 8, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.43.1 (1) release

⚙️ sentry-android Build Distribution Settings

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