@danieljvdm/dev-kit 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/package.json +1 -1
- package/skill-sources.jsonc +2 -33
- package/skill-sources.lock.json +15 -117
- package/skills/animate/LICENSE +21 -0
- package/skills/animate/NOTICE +10 -0
- package/skills/animate/SKILL.md +34 -0
- package/skills/animate/references/gestures.md +27 -0
- package/skills/animate/references/glossary.md +136 -0
- package/skills/animate/references/implementation.md +22 -0
- package/skills/animate/references/opportunities.md +18 -0
- package/skills/animate/references/principles.md +48 -0
- package/skills/animate/references/review.md +19 -0
- package/skills/cloudflare-workers/LICENSE +202 -0
- package/skills/cloudflare-workers/NOTICE +9 -0
- package/skills/cloudflare-workers/SKILL.md +26 -0
- package/skills/cloudflare-workers/references/durable-objects.md +68 -0
- package/skills/cloudflare-workers/references/sandbox.md +48 -0
- package/skills/cloudflare-workers/references/workers.md +63 -0
- package/skills/cloudflare-workers/references/wrangler.md +56 -0
- package/skills/design-ui/LICENSE +21 -0
- package/skills/design-ui/NOTICE +8 -0
- package/skills/design-ui/SKILL.md +29 -0
- package/skills/design-ui/references/appearance.md +22 -0
- package/skills/design-ui/references/components.md +33 -0
- package/skills/design-ui/references/exploration.md +50 -0
- package/skills/design-ui/references/libraries.md +39 -0
- package/skills/design-ui/references/themes.md +23 -0
- package/skills/dev-kit/SKILL.md +19 -38
- package/skills/dev-kit/references/cloudflare-worker-api.md +1 -1
- package/skills/dev-kit/references/skills.md +2 -2
- package/skills/effect-development/SKILL.md +27 -0
- package/skills/effect-development/agents/openai.yaml +4 -0
- package/skills/effect-development/references/api/index.md +32 -0
- package/skills/effect-development/references/api/schema-codecs.md +15 -0
- package/skills/{build-effect-apis/references → effect-development/references/api}/verification.md +10 -5
- package/skills/{effect-architecture-audit/SKILL.md → effect-development/references/architecture/index.md} +1 -6
- package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-client.md +8 -6
- package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-testing.md +7 -2
- package/skills/effect-development/references/atom/index.md +40 -0
- package/skills/{build-effect-clis/references → effect-development/references/cli}/entrypoints-and-testing.md +6 -2
- package/skills/effect-development/references/cli/index.md +39 -0
- package/skills/effect-development/references/setup.md +15 -0
- package/skills/open-pull-request/SKILL.md +10 -70
- package/skills/open-pull-request/references/evidence.md +22 -0
- package/skills/open-pull-request/references/explanation.md +21 -0
- package/skills/open-pull-request/references/publication.md +21 -0
- package/skills/sentry/LICENSE +202 -0
- package/skills/sentry/LICENSE-UPSTREAM +21 -0
- package/skills/sentry/NOTICE +14 -0
- package/skills/sentry/SKILL.md +33 -0
- package/skills/sentry/references/alert-payloads.md +105 -0
- package/skills/sentry/references/alerts.md +17 -0
- package/skills/sentry/references/artifacts.md +25 -0
- package/skills/sentry/references/auth-token.md +65 -0
- package/skills/sentry/references/concepts/ai-monitoring.md +131 -0
- package/skills/sentry/references/concepts/choosing-a-signal.md +78 -0
- package/skills/sentry/references/concepts/crons.md +50 -0
- package/skills/sentry/references/concepts/data-scrubbing.md +43 -0
- package/skills/sentry/references/concepts/errors.md +40 -0
- package/skills/sentry/references/concepts/logging.md +85 -0
- package/skills/sentry/references/concepts/metrics.md +49 -0
- package/skills/sentry/references/concepts/monitors.md +78 -0
- package/skills/sentry/references/concepts/profiling.md +38 -0
- package/skills/sentry/references/concepts/reduce-volume.md +49 -0
- package/skills/sentry/references/concepts/releases.md +43 -0
- package/skills/sentry/references/concepts/session-replay.md +35 -0
- package/skills/sentry/references/concepts/tracing.md +54 -0
- package/skills/sentry/references/concepts/user-feedback.md +36 -0
- package/skills/sentry/references/debug-artifacts/android.md +68 -0
- package/skills/sentry/references/debug-artifacts/apple.md +96 -0
- package/skills/sentry/references/debug-artifacts/dotnet.md +70 -0
- package/skills/sentry/references/debug-artifacts/flutter.md +65 -0
- package/skills/sentry/references/debug-artifacts/index.md +75 -0
- package/skills/sentry/references/debug-artifacts/javascript.md +94 -0
- package/skills/sentry/references/debug-artifacts/matching.md +73 -0
- package/skills/sentry/references/debug-artifacts/react-native.md +75 -0
- package/skills/sentry/references/first-error-setup.md +25 -0
- package/skills/sentry/references/instrumentation.md +30 -0
- package/skills/sentry/references/issues.md +32 -0
- package/skills/sentry/references/new-project.md +17 -0
- package/skills/sentry/references/otel-exporter.md +30 -0
- package/skills/sentry/references/release-workflow.md +31 -0
- package/skills/sentry/references/releases/ci-pipeline.md +214 -0
- package/skills/sentry/references/releases/index.md +93 -0
- package/skills/sentry/references/releases/suspect-commits.md +155 -0
- package/skills/sentry/references/releases/tagging.md +131 -0
- package/skills/sentry/references/releases/troubleshooting.md +67 -0
- package/skills/sentry/references/sdks/android/crons.md +305 -0
- package/skills/sentry/references/sdks/android/error-monitoring.md +800 -0
- package/skills/sentry/references/sdks/android/index.md +748 -0
- package/skills/sentry/references/sdks/android/integrations.md +48 -0
- package/skills/sentry/references/sdks/android/logging.md +374 -0
- package/skills/sentry/references/sdks/android/metrics.md +288 -0
- package/skills/sentry/references/sdks/android/profiling.md +397 -0
- package/skills/sentry/references/sdks/android/session-replay.md +406 -0
- package/skills/sentry/references/sdks/android/tracing.md +861 -0
- package/skills/sentry/references/sdks/browser/error-monitoring.md +861 -0
- package/skills/sentry/references/sdks/browser/index.md +714 -0
- package/skills/sentry/references/sdks/browser/logging.md +315 -0
- package/skills/sentry/references/sdks/browser/profiling.md +236 -0
- package/skills/sentry/references/sdks/browser/session-replay.md +586 -0
- package/skills/sentry/references/sdks/browser/tracing.md +561 -0
- package/skills/sentry/references/sdks/browser/user-feedback.md +354 -0
- package/skills/sentry/references/sdks/cloudflare/ai-monitoring.md +661 -0
- package/skills/sentry/references/sdks/cloudflare/crons.md +231 -0
- package/skills/sentry/references/sdks/cloudflare/durable-objects.md +381 -0
- package/skills/sentry/references/sdks/cloudflare/error-monitoring.md +329 -0
- package/skills/sentry/references/sdks/cloudflare/index.md +698 -0
- package/skills/sentry/references/sdks/cloudflare/logging.md +169 -0
- package/skills/sentry/references/sdks/cloudflare/nodejs-compat.md +134 -0
- package/skills/sentry/references/sdks/cloudflare/tracing.md +475 -0
- package/skills/sentry/references/sdks/cocoa/error-monitoring.md +394 -0
- package/skills/sentry/references/sdks/cocoa/index.md +497 -0
- package/skills/sentry/references/sdks/cocoa/logging.md +209 -0
- package/skills/sentry/references/sdks/cocoa/metrics.md +136 -0
- package/skills/sentry/references/sdks/cocoa/profiling.md +223 -0
- package/skills/sentry/references/sdks/cocoa/session-replay.md +257 -0
- package/skills/sentry/references/sdks/cocoa/tracing.md +524 -0
- package/skills/sentry/references/sdks/cocoa/user-feedback.md +310 -0
- package/skills/sentry/references/sdks/dotnet/crons.md +465 -0
- package/skills/sentry/references/sdks/dotnet/error-monitoring.md +1100 -0
- package/skills/sentry/references/sdks/dotnet/index.md +614 -0
- package/skills/sentry/references/sdks/dotnet/logging.md +556 -0
- package/skills/sentry/references/sdks/dotnet/metrics.md +229 -0
- package/skills/sentry/references/sdks/dotnet/profiling.md +296 -0
- package/skills/sentry/references/sdks/dotnet/tracing.md +897 -0
- package/skills/sentry/references/sdks/elixir/crons.md +371 -0
- package/skills/sentry/references/sdks/elixir/error-monitoring.md +335 -0
- package/skills/sentry/references/sdks/elixir/index.md +383 -0
- package/skills/sentry/references/sdks/elixir/logging.md +239 -0
- package/skills/sentry/references/sdks/elixir/tracing.md +233 -0
- package/skills/sentry/references/sdks/flutter/ecosystem-integrations.md +70 -0
- package/skills/sentry/references/sdks/flutter/error-monitoring.md +312 -0
- package/skills/sentry/references/sdks/flutter/index.md +728 -0
- package/skills/sentry/references/sdks/flutter/logging.md +387 -0
- package/skills/sentry/references/sdks/flutter/metrics.md +310 -0
- package/skills/sentry/references/sdks/flutter/profiling.md +214 -0
- package/skills/sentry/references/sdks/flutter/session-replay.md +308 -0
- package/skills/sentry/references/sdks/flutter/tracing.md +502 -0
- package/skills/sentry/references/sdks/go/crons.md +270 -0
- package/skills/sentry/references/sdks/go/error-monitoring.md +361 -0
- package/skills/sentry/references/sdks/go/index.md +324 -0
- package/skills/sentry/references/sdks/go/logging.md +354 -0
- package/skills/sentry/references/sdks/go/metrics.md +273 -0
- package/skills/sentry/references/sdks/go/profiling.md +46 -0
- package/skills/sentry/references/sdks/go/tracing.md +366 -0
- package/skills/sentry/references/sdks/index.md +41 -0
- package/skills/sentry/references/sdks/nestjs/ai-monitoring.md +410 -0
- package/skills/sentry/references/sdks/nestjs/crons.md +268 -0
- package/skills/sentry/references/sdks/nestjs/error-monitoring.md +729 -0
- package/skills/sentry/references/sdks/nestjs/index.md +699 -0
- package/skills/sentry/references/sdks/nestjs/logging.md +174 -0
- package/skills/sentry/references/sdks/nestjs/metrics.md +243 -0
- package/skills/sentry/references/sdks/nestjs/profiling.md +127 -0
- package/skills/sentry/references/sdks/nestjs/tracing.md +762 -0
- package/skills/sentry/references/sdks/nextjs/ai-monitoring.md +494 -0
- package/skills/sentry/references/sdks/nextjs/crons.md +383 -0
- package/skills/sentry/references/sdks/nextjs/error-monitoring.md +974 -0
- package/skills/sentry/references/sdks/nextjs/index.md +491 -0
- package/skills/sentry/references/sdks/nextjs/logging.md +381 -0
- package/skills/sentry/references/sdks/nextjs/metrics.md +411 -0
- package/skills/sentry/references/sdks/nextjs/profiling.md +403 -0
- package/skills/sentry/references/sdks/nextjs/session-replay.md +462 -0
- package/skills/sentry/references/sdks/nextjs/tracing.md +628 -0
- package/skills/sentry/references/sdks/node/ai-monitoring.md +303 -0
- package/skills/sentry/references/sdks/node/crons.md +432 -0
- package/skills/sentry/references/sdks/node/error-monitoring.md +1125 -0
- package/skills/sentry/references/sdks/node/index.md +942 -0
- package/skills/sentry/references/sdks/node/logging.md +380 -0
- package/skills/sentry/references/sdks/node/metrics.md +278 -0
- package/skills/sentry/references/sdks/node/profiling.md +373 -0
- package/skills/sentry/references/sdks/node/tracing.md +878 -0
- package/skills/sentry/references/sdks/php/ai-monitoring.md +310 -0
- package/skills/sentry/references/sdks/php/crons.md +265 -0
- package/skills/sentry/references/sdks/php/error-monitoring.md +626 -0
- package/skills/sentry/references/sdks/php/index.md +362 -0
- package/skills/sentry/references/sdks/php/laravel.md +542 -0
- package/skills/sentry/references/sdks/php/logging.md +242 -0
- package/skills/sentry/references/sdks/php/metrics.md +193 -0
- package/skills/sentry/references/sdks/php/profiling.md +115 -0
- package/skills/sentry/references/sdks/php/symfony.md +552 -0
- package/skills/sentry/references/sdks/php/tracing.md +516 -0
- package/skills/sentry/references/sdks/python/ai-monitoring.md +351 -0
- package/skills/sentry/references/sdks/python/crons.md +218 -0
- package/skills/sentry/references/sdks/python/error-monitoring.md +292 -0
- package/skills/sentry/references/sdks/python/index.md +361 -0
- package/skills/sentry/references/sdks/python/logging.md +234 -0
- package/skills/sentry/references/sdks/python/metrics.md +154 -0
- package/skills/sentry/references/sdks/python/profiling.md +120 -0
- package/skills/sentry/references/sdks/python/tracing.md +364 -0
- package/skills/sentry/references/sdks/react/error-monitoring.md +1607 -0
- package/skills/sentry/references/sdks/react/index.md +492 -0
- package/skills/sentry/references/sdks/react/logging.md +364 -0
- package/skills/sentry/references/sdks/react/profiling.md +322 -0
- package/skills/sentry/references/sdks/react/react-features.md +1272 -0
- package/skills/sentry/references/sdks/react/session-replay.md +1193 -0
- package/skills/sentry/references/sdks/react/tracing.md +1415 -0
- package/skills/sentry/references/sdks/react-native/error-monitoring.md +1481 -0
- package/skills/sentry/references/sdks/react-native/expo-config-plugin.md +45 -0
- package/skills/sentry/references/sdks/react-native/index.md +1030 -0
- package/skills/sentry/references/sdks/react-native/logging.md +444 -0
- package/skills/sentry/references/sdks/react-native/profiling.md +386 -0
- package/skills/sentry/references/sdks/react-native/session-replay.md +704 -0
- package/skills/sentry/references/sdks/react-native/tracing.md +1086 -0
- package/skills/sentry/references/sdks/react-native/user-feedback.md +815 -0
- package/skills/sentry/references/sdks/react-router-framework/error-monitoring.md +127 -0
- package/skills/sentry/references/sdks/react-router-framework/index.md +411 -0
- package/skills/sentry/references/sdks/react-router-framework/logging.md +66 -0
- package/skills/sentry/references/sdks/react-router-framework/profiling.md +57 -0
- package/skills/sentry/references/sdks/react-router-framework/react-router-framework-features.md +110 -0
- package/skills/sentry/references/sdks/react-router-framework/session-replay.md +67 -0
- package/skills/sentry/references/sdks/react-router-framework/tracing.md +96 -0
- package/skills/sentry/references/sdks/react-router-framework/user-feedback.md +71 -0
- package/skills/sentry/references/sdks/ruby/crons.md +184 -0
- package/skills/sentry/references/sdks/ruby/error-monitoring.md +248 -0
- package/skills/sentry/references/sdks/ruby/index.md +297 -0
- package/skills/sentry/references/sdks/ruby/logging.md +168 -0
- package/skills/sentry/references/sdks/ruby/metrics.md +196 -0
- package/skills/sentry/references/sdks/ruby/migration.md +321 -0
- package/skills/sentry/references/sdks/ruby/profiling.md +107 -0
- package/skills/sentry/references/sdks/ruby/tracing.md +388 -0
- package/skills/sentry/references/sdks/svelte/error-monitoring.md +456 -0
- package/skills/sentry/references/sdks/svelte/index.md +467 -0
- package/skills/sentry/references/sdks/svelte/logging.md +344 -0
- package/skills/sentry/references/sdks/svelte/session-replay.md +369 -0
- package/skills/sentry/references/sdks/svelte/tracing.md +406 -0
- package/skills/sentry/references/sdks/tanstack-start/error-monitoring.md +149 -0
- package/skills/sentry/references/sdks/tanstack-start/index.md +381 -0
- package/skills/sentry/references/sdks/tanstack-start/logging.md +74 -0
- package/skills/sentry/references/sdks/tanstack-start/session-replay.md +76 -0
- package/skills/sentry/references/sdks/tanstack-start/tanstackstart-features.md +128 -0
- package/skills/sentry/references/sdks/tanstack-start/tracing.md +123 -0
- package/skills/sentry/references/sdks/tanstack-start/user-feedback.md +81 -0
- package/skills/sentry/references/search-query-language.md +226 -0
- package/skills/sentry/references/semantics/angular.md +7 -0
- package/skills/sentry/references/semantics/app.md +28 -0
- package/skills/sentry/references/semantics/art.md +17 -0
- package/skills/sentry/references/semantics/aws.md +43 -0
- package/skills/sentry/references/semantics/browser.md +34 -0
- package/skills/sentry/references/semantics/cache.md +12 -0
- package/skills/sentry/references/semantics/client.md +8 -0
- package/skills/sentry/references/semantics/cloud.md +12 -0
- package/skills/sentry/references/semantics/cloudflare.md +23 -0
- package/skills/sentry/references/semantics/code.md +11 -0
- package/skills/sentry/references/semantics/culture.md +11 -0
- package/skills/sentry/references/semantics/db.md +21 -0
- package/skills/sentry/references/semantics/device.md +43 -0
- package/skills/sentry/references/semantics/error.md +7 -0
- package/skills/sentry/references/semantics/event.md +8 -0
- package/skills/sentry/references/semantics/exception.md +10 -0
- package/skills/sentry/references/semantics/faas.md +19 -0
- package/skills/sentry/references/semantics/file.md +8 -0
- package/skills/sentry/references/semantics/flag.md +7 -0
- package/skills/sentry/references/semantics/gcp.md +16 -0
- package/skills/sentry/references/semantics/gen_ai.md +53 -0
- package/skills/sentry/references/semantics/general.md +11 -0
- package/skills/sentry/references/semantics/graphql.md +9 -0
- package/skills/sentry/references/semantics/grpc.md +19 -0
- package/skills/sentry/references/semantics/http.md +34 -0
- package/skills/sentry/references/semantics/index.md +63 -0
- package/skills/sentry/references/semantics/jsonrpc.md +8 -0
- package/skills/sentry/references/semantics/jvm.md +12 -0
- package/skills/sentry/references/semantics/koa.md +7 -0
- package/skills/sentry/references/semantics/logger.md +7 -0
- package/skills/sentry/references/semantics/mcp.md +37 -0
- package/skills/sentry/references/semantics/mdc.md +7 -0
- package/skills/sentry/references/semantics/messaging.md +23 -0
- package/skills/sentry/references/semantics/middleware.md +7 -0
- package/skills/sentry/references/semantics/navigation.md +9 -0
- package/skills/sentry/references/semantics/nel.md +11 -0
- package/skills/sentry/references/semantics/network.md +17 -0
- package/skills/sentry/references/semantics/os.md +15 -0
- package/skills/sentry/references/semantics/otel.md +10 -0
- package/skills/sentry/references/semantics/params.md +7 -0
- package/skills/sentry/references/semantics/process.md +14 -0
- package/skills/sentry/references/semantics/react.md +7 -0
- package/skills/sentry/references/semantics/remix.md +7 -0
- package/skills/sentry/references/semantics/resource.md +7 -0
- package/skills/sentry/references/semantics/rpc.md +10 -0
- package/skills/sentry/references/semantics/score.md +10 -0
- package/skills/sentry/references/semantics/sentry.md +69 -0
- package/skills/sentry/references/semantics/server.md +8 -0
- package/skills/sentry/references/semantics/service.md +8 -0
- package/skills/sentry/references/semantics/session.md +7 -0
- package/skills/sentry/references/semantics/state.md +7 -0
- package/skills/sentry/references/semantics/thread.md +8 -0
- package/skills/sentry/references/semantics/timber.md +7 -0
- package/skills/sentry/references/semantics/trpc.md +8 -0
- package/skills/sentry/references/semantics/ui.md +18 -0
- package/skills/sentry/references/semantics/url.md +15 -0
- package/skills/sentry/references/semantics/user.md +17 -0
- package/skills/sentry/references/semantics/user_agent.md +7 -0
- package/skills/sentry/references/semantics/vercel.md +42 -0
- package/skills/sentry/references/setup-verification.md +39 -0
- package/skills/sentry/references/snapshots/github-actions-fanout.md +206 -0
- package/skills/sentry/references/snapshots/github-actions-simple.md +102 -0
- package/skills/sentry/references/snapshots/github-actions-swift-snapshot-testing.md +118 -0
- package/skills/sentry/references/snapshots/index.md +19 -0
- package/skills/sentry/references/snapshots/snapshot-previews.md +100 -0
- package/skills/sentry/references/snapshots/snapshots.md +123 -0
- package/skills/sentry/references/snapshots/wizard-setup.md +134 -0
- package/skills/testing/LICENSE +21 -0
- package/skills/testing/NOTICE +7 -0
- package/skills/testing/SKILL.md +13 -19
- package/skills/testing/agents/openai.yaml +1 -2
- package/skills/testing/references/selection.md +23 -0
- package/skills/testing/references/tdd.md +19 -0
- package/skills/testing/references/test-design.md +17 -0
- package/src/catalog.ts +1 -7
- package/skills/build-effect-apis/SKILL.md +0 -81
- package/skills/build-effect-apis/agents/openai.yaml +0 -4
- package/skills/build-effect-clis/SKILL.md +0 -92
- package/skills/build-effect-clis/agents/openai.yaml +0 -4
- package/skills/effect-architecture-audit/agents/openai.yaml +0 -4
- package/skills/effect-atom-state/SKILL.md +0 -97
- package/skills/effect-atom-state/agents/openai.yaml +0 -4
- package/skills/effect-ts/SKILL.md +0 -35
- package/skills/effect-ts/agents/openai.yaml +0 -4
- /package/skills/{build-effect-apis/references → effect-development/references/api}/cloudflare-workers.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/runtime-assembly.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/server-and-middleware.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/shared-contracts.md +0 -0
- /package/skills/{effect-architecture-audit/references → effect-development/references/architecture}/service-and-boundary-audit.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-lifecycle.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-workflows.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/tanstack-start.md +0 -0
- /package/skills/{build-effect-clis/references → effect-development/references/cli}/command-design.md +0 -0
- /package/skills/{build-effect-clis/references → effect-development/references/cli}/processes-and-platform.md +0 -0
|
@@ -0,0 +1,861 @@
|
|
|
1
|
+
# Tracing & Performance Monitoring — Sentry Android SDK
|
|
2
|
+
|
|
3
|
+
> **Minimum SDK:** `io.sentry:sentry-android` ≥ 7.0.0 (≥ 8.0.0 recommended) **Gradle
|
|
4
|
+
> Plugin:** `io.sentry:sentry-android-gradle-plugin` ≥ 6.1.0 for zero-source-change
|
|
5
|
+
> instrumentation **Languages:** Kotlin and Java — all examples in Kotlin with Java
|
|
6
|
+
> equivalents where they differ **Mobile-first note:** Android has unique capabilities
|
|
7
|
+
> web SDKs lack — Activity TTID/TTFD, slow/frozen frame counts, app start tracking
|
|
8
|
+
> (cold/warm), and user interaction tracing.
|
|
9
|
+
> These are first-class citizens in `sentry-android`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
1. [Basic Tracing Setup](#1-basic-tracing-setup)
|
|
16
|
+
2. [Auto-Instrumentation Overview](#2-auto-instrumentation-overview)
|
|
17
|
+
3. [App Start Tracing — Cold & Warm](#3-app-start-tracing--cold--warm)
|
|
18
|
+
4. [Activity Lifecycle — TTID & TTFD](#4-activity-lifecycle--ttid--ttfd)
|
|
19
|
+
5. [Fragment Lifecycle Tracing](#5-fragment-lifecycle-tracing)
|
|
20
|
+
6. [OkHttp Network Tracing](#6-okhttp-network-tracing)
|
|
21
|
+
7. [SQLite / Room Database Tracing](#7-sqlite--room-database-tracing)
|
|
22
|
+
8. [Jetpack Compose Navigation](#8-jetpack-compose-navigation)
|
|
23
|
+
9. [File I/O Tracing](#9-file-io-tracing)
|
|
24
|
+
10. [User Interaction Tracing](#10-user-interaction-tracing)
|
|
25
|
+
11. [Slow & Frozen Frames](#11-slow--frozen-frames)
|
|
26
|
+
12. [Sentry Gradle Plugin — Zero-Source-Change Instrumentation](#12-sentry-gradle-plugin--zero-source-change-instrumentation)
|
|
27
|
+
13. [Custom Spans](#13-custom-spans)
|
|
28
|
+
14. [Distributed Tracing](#14-distributed-tracing)
|
|
29
|
+
15. [Dynamic Sampling](#15-dynamic-sampling)
|
|
30
|
+
16. [Configuration Reference](#16-configuration-reference)
|
|
31
|
+
17. [Troubleshooting](#17-troubleshooting)
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 1. Basic Tracing Setup
|
|
36
|
+
|
|
37
|
+
```kotlin
|
|
38
|
+
// Application.kt
|
|
39
|
+
import io.sentry.android.core.SentryAndroid
|
|
40
|
+
|
|
41
|
+
SentryAndroid.init(this) { options ->
|
|
42
|
+
options.dsn = "YOUR_DSN"
|
|
43
|
+
|
|
44
|
+
// Option A: uniform sample rate (0.0–1.0)
|
|
45
|
+
// 1.0 = 100% of transactions — development/testing only
|
|
46
|
+
options.tracesSampleRate = 1.0
|
|
47
|
+
|
|
48
|
+
// Option B: dynamic sampler — overrides tracesSampleRate when set
|
|
49
|
+
// options.tracesSampler = TracesSamplerCallback { ctx ->
|
|
50
|
+
// if (ctx.transactionContext.name.startsWith("Checkout")) 1.0 else 0.2
|
|
51
|
+
// }
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> **Production recommendation:** Use `tracesSampleRate = 0.2` or lower, or use
|
|
56
|
+
> `tracesSampler` for context-aware control.
|
|
57
|
+
> 100% sampling causes high volume at scale.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 2. Auto-Instrumentation Overview
|
|
62
|
+
|
|
63
|
+
The SDK instruments three layers automatically.
|
|
64
|
+
Each layer builds on the previous:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
TIER 1 — Build-time bytecode (Gradle Plugin)
|
|
68
|
+
DATABASE → Room / SQLite → db.sql.query spans (zero source changes)
|
|
69
|
+
FILE_IO → FileInputStream/OutputStream → file.read/write spans
|
|
70
|
+
OKHTTP → OkHttpClient.Builder.build() → SentryOkHttpInterceptor injected
|
|
71
|
+
COMPOSE → rememberNavController() → withSentryObservableEffect() wrapped
|
|
72
|
+
|
|
73
|
+
TIER 2 — Runtime (SDK integrations, opt-in via options/manifest)
|
|
74
|
+
ActivityLifecycleIntegration → ui.load + TTID + TTFD per Activity
|
|
75
|
+
FragmentLifecycleIntegration → ui.load per Fragment
|
|
76
|
+
SentryOkHttpInterceptor → http.client per request
|
|
77
|
+
SentryOkHttpEventListener → 9 DNS/TLS/connect sub-spans
|
|
78
|
+
SQLiteSpanManager → db.sql.query per query
|
|
79
|
+
SentryNavigationListener → navigation per route change
|
|
80
|
+
UserInteractionIntegration → ui.action.click per gesture
|
|
81
|
+
|
|
82
|
+
TIER 3 — Manual (your code)
|
|
83
|
+
Sentry.startTransaction() / ISpan.startChild() public API
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Binding matters:** For auto-instrumented child spans (OkHttp, SQLite, Fragment) to
|
|
87
|
+
attach to your transaction, the transaction must be bound to scope:
|
|
88
|
+
`opts.isBindToScope = true`.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 3. App Start Tracing — Cold & Warm
|
|
93
|
+
|
|
94
|
+
**Unique to mobile.** Tracks from the earliest process initialization to first Activity
|
|
95
|
+
render.
|
|
96
|
+
|
|
97
|
+
| Metric | Span operation | When |
|
|
98
|
+
| -------------- | ---------------- | ------------------------------------- |
|
|
99
|
+
| **Cold start** | `app.start.cold` | Process launched from scratch |
|
|
100
|
+
| **Warm start** | `app.start.warm` | Process in memory, Activity recreated |
|
|
101
|
+
|
|
102
|
+
App start data appears as the **first child span** inside the first Activity’s `ui.load`
|
|
103
|
+
transaction. It is not a standalone transaction.
|
|
104
|
+
|
|
105
|
+
`SentryPerformanceProvider` — a `ContentProvider` in the SDK’s manifest — captures the
|
|
106
|
+
earliest possible timestamp before `Application.onCreate()`.
|
|
107
|
+
|
|
108
|
+
No configuration needed — app start tracking is automatic when Activity tracing is
|
|
109
|
+
enabled.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 4. Activity Lifecycle — TTID & TTFD
|
|
114
|
+
|
|
115
|
+
Activity tracing is **enabled by default**. Each Activity launch generates a `ui.load`
|
|
116
|
+
transaction with TTID and optionally TTFD spans.
|
|
117
|
+
|
|
118
|
+
| Lifecycle event | SDK action |
|
|
119
|
+
| ------------------------------------- | ------------------------------------------------------------ |
|
|
120
|
+
| `onActivityPreCreated()` | Start `ui.load` transaction + `ui.load.initial_display` span |
|
|
121
|
+
| First frame rendered | Finish `ui.load.initial_display` (TTID complete) |
|
|
122
|
+
| `Sentry.reportFullyDisplayed()` | Finish `ui.load.full_display` (TTFD complete) |
|
|
123
|
+
| 25 s without `reportFullyDisplayed()` | Auto-finish TTFD with `DEADLINE_EXCEEDED` |
|
|
124
|
+
|
|
125
|
+
### TTID (Time to Initial Display)
|
|
126
|
+
|
|
127
|
+
Automatic — enabled with Activity tracing.
|
|
128
|
+
Appears as `ui.load.initial_display` span.
|
|
129
|
+
|
|
130
|
+
### TTFD (Time to Full Display)
|
|
131
|
+
|
|
132
|
+
Opt-in. Call `Sentry.reportFullyDisplayed()` when all async content is loaded:
|
|
133
|
+
|
|
134
|
+
```kotlin
|
|
135
|
+
class ProductListActivity : AppCompatActivity() {
|
|
136
|
+
|
|
137
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
138
|
+
super.onCreate(savedInstanceState)
|
|
139
|
+
setContentView(R.layout.activity_product_list)
|
|
140
|
+
|
|
141
|
+
viewModel.products.observe(this) { products ->
|
|
142
|
+
adapter.submitList(products)
|
|
143
|
+
// Signal that the screen is fully populated with data
|
|
144
|
+
Sentry.reportFullyDisplayed()
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Enable in manifest:
|
|
151
|
+
|
|
152
|
+
```xml
|
|
153
|
+
<meta-data
|
|
154
|
+
android:name="io.sentry.traces.time-to-full-display.enable"
|
|
155
|
+
android:value="true" />
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Or in code:
|
|
159
|
+
|
|
160
|
+
```kotlin
|
|
161
|
+
options.isEnableTimeToFullDisplayTracing = true
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Frame measurements** are automatically attached to every Activity transaction:
|
|
165
|
+
|
|
166
|
+
| Measurement key | Threshold |
|
|
167
|
+
| --------------- | ------------------------ |
|
|
168
|
+
| `frames_total` | All rendered frames |
|
|
169
|
+
| `frames_slow` | 16 ms – 700 ms per frame |
|
|
170
|
+
| `frames_frozen` | > 700 ms per frame |
|
|
171
|
+
|
|
172
|
+
Requires Android API 24+.
|
|
173
|
+
|
|
174
|
+
### Disable Activity tracing
|
|
175
|
+
|
|
176
|
+
```kotlin
|
|
177
|
+
options.isEnableAutoActivityLifecycleTracing = false
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 5. Fragment Lifecycle Tracing
|
|
183
|
+
|
|
184
|
+
Not enabled by default.
|
|
185
|
+
Adds `FragmentLifecycleIntegration` to instrument Fragment screen loads.
|
|
186
|
+
|
|
187
|
+
```kotlin
|
|
188
|
+
import io.sentry.android.fragment.FragmentLifecycleIntegration
|
|
189
|
+
|
|
190
|
+
SentryAndroid.init(this) { options ->
|
|
191
|
+
options.addIntegration(
|
|
192
|
+
FragmentLifecycleIntegration(
|
|
193
|
+
application = this,
|
|
194
|
+
enableAutoFragmentLifecycleTracing = true, // create spans (default: false)
|
|
195
|
+
filterFragmentLifecycleBreadcrumbs = setOf(
|
|
196
|
+
FragmentLifecycleState.CREATED,
|
|
197
|
+
FragmentLifecycleState.RESUMED,
|
|
198
|
+
FragmentLifecycleState.DESTROYED,
|
|
199
|
+
)
|
|
200
|
+
)
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Dependency:
|
|
206
|
+
|
|
207
|
+
```kotlin
|
|
208
|
+
implementation("io.sentry:sentry-android-fragment:8.33.0")
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
> **Important:** Fragment spans attach to `scopes.getTransaction()`. If no scope-bound
|
|
212
|
+
> transaction is active, fragment spans are silently dropped.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 6. OkHttp Network Tracing
|
|
217
|
+
|
|
218
|
+
`SentryOkHttpInterceptor` creates a `http.client` span for every OkHttp request made
|
|
219
|
+
while a transaction is active.
|
|
220
|
+
|
|
221
|
+
### Manual setup
|
|
222
|
+
|
|
223
|
+
```kotlin
|
|
224
|
+
import io.sentry.okhttp.SentryOkHttpInterceptor
|
|
225
|
+
import io.sentry.okhttp.SentryOkHttpEventListener
|
|
226
|
+
|
|
227
|
+
val okHttpClient = OkHttpClient.Builder()
|
|
228
|
+
.eventListener(SentryOkHttpEventListener()) // 9 sub-spans (DNS, TLS, connect, etc.)
|
|
229
|
+
.addInterceptor(
|
|
230
|
+
SentryOkHttpInterceptor(
|
|
231
|
+
captureFailedRequests = true, // capture non-2xx as Sentry errors
|
|
232
|
+
beforeSpan = { span, request, response ->
|
|
233
|
+
// Return null to skip span for this request
|
|
234
|
+
if (request.url.encodedPath.contains("/health")) null else span
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
)
|
|
238
|
+
.build()
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Dependency:
|
|
242
|
+
|
|
243
|
+
```kotlin
|
|
244
|
+
implementation("io.sentry:sentry-okhttp:8.33.0")
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Sub-spans from `SentryOkHttpEventListener`
|
|
248
|
+
|
|
249
|
+
| Span | Phase |
|
|
250
|
+
| ------------------------------------- | ----------------------------- |
|
|
251
|
+
| `http.client.proxy_select_ms` | Proxy selection |
|
|
252
|
+
| `http.client.resolve_dns_ms` | DNS resolution |
|
|
253
|
+
| `http.connect_ms` | TCP connect |
|
|
254
|
+
| `http.connect.secure_connect_ms` | TLS handshake |
|
|
255
|
+
| `http.connection_ms` | Connection acquired from pool |
|
|
256
|
+
| `http.connection.request_headers_ms` | Request headers sent |
|
|
257
|
+
| `http.connection.request_body_ms` | Request body sent |
|
|
258
|
+
| `http.connection.response_headers_ms` | Response headers received |
|
|
259
|
+
| `http.connection.response_body_ms` | Response body consumed |
|
|
260
|
+
|
|
261
|
+
### Distributed tracing with OkHttp
|
|
262
|
+
|
|
263
|
+
OkHttp automatically attaches `sentry-trace` and `baggage` headers to requests targeting
|
|
264
|
+
`tracePropagationTargets`. See [Distributed Tracing](#14-distributed-tracing).
|
|
265
|
+
|
|
266
|
+
> **Note:** On Android, OkHttp spans attach to the root transaction (not the innermost
|
|
267
|
+
> active span). HTTP spans always appear at transaction level.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## 7. SQLite / Room Database Tracing
|
|
272
|
+
|
|
273
|
+
Creates a `db.sql.query` span for every SQLite query when wrapped correctly.
|
|
274
|
+
|
|
275
|
+
### Manual setup (no Gradle Plugin)
|
|
276
|
+
|
|
277
|
+
```kotlin
|
|
278
|
+
import io.sentry.android.sqlite.SentrySupportSQLiteOpenHelper
|
|
279
|
+
|
|
280
|
+
// With Room:
|
|
281
|
+
val db = Room.databaseBuilder(context, AppDatabase::class.java, "app.db")
|
|
282
|
+
.openHelperFactory(SentrySupportSQLiteOpenHelper.Factory(FrameworkSQLiteOpenHelperFactory()))
|
|
283
|
+
.build()
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Dependency:
|
|
287
|
+
|
|
288
|
+
```kotlin
|
|
289
|
+
implementation("io.sentry:sentry-android-sqlite:8.33.0")
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Span data
|
|
293
|
+
|
|
294
|
+
Each `db.sql.query` span includes:
|
|
295
|
+
|
|
296
|
+
- `db.system`: `"sqlite"` or `"in-memory"`
|
|
297
|
+
- `db.name`: database file name
|
|
298
|
+
- `blocked_main_thread`: `true` if query ran on the main thread
|
|
299
|
+
- `call_stack`: in-app stack frames (when main thread is blocked)
|
|
300
|
+
|
|
301
|
+
> **Performance warning:** The `blocked_main_thread` field flags queries running on the
|
|
302
|
+
> main thread — a common source of UI jank.
|
|
303
|
+
> Move database queries to a background dispatcher.
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## 8. Jetpack Compose Navigation
|
|
308
|
+
|
|
309
|
+
Creates a `navigation` transaction for each screen transition in `NavHost`.
|
|
310
|
+
|
|
311
|
+
### Manual setup
|
|
312
|
+
|
|
313
|
+
```kotlin
|
|
314
|
+
import io.sentry.compose.withSentryObservableEffect
|
|
315
|
+
|
|
316
|
+
@Composable
|
|
317
|
+
fun AppNavigation() {
|
|
318
|
+
val navController = rememberNavController()
|
|
319
|
+
.withSentryObservableEffect(
|
|
320
|
+
enableNavigationBreadcrumbs = true,
|
|
321
|
+
enableNavigationTracing = true,
|
|
322
|
+
)
|
|
323
|
+
NavHost(navController = navController, startDestination = "home") {
|
|
324
|
+
composable("home") { HomeScreen() }
|
|
325
|
+
composable("profile/{userId}") { ProfileScreen() }
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Labeling interactive elements
|
|
331
|
+
|
|
332
|
+
```kotlin
|
|
333
|
+
import io.sentry.compose.sentryTag
|
|
334
|
+
|
|
335
|
+
// sentryTag provides a label for user interaction transactions
|
|
336
|
+
Button(
|
|
337
|
+
modifier = Modifier.sentryTag("checkout-button"),
|
|
338
|
+
onClick = { onCheckout() }
|
|
339
|
+
) {
|
|
340
|
+
Text("Checkout")
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Dependency:
|
|
345
|
+
|
|
346
|
+
```kotlin
|
|
347
|
+
implementation("io.sentry:sentry-compose-android:8.33.0")
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## 9. File I/O Tracing
|
|
353
|
+
|
|
354
|
+
Creates `file.read` and `file.write` spans for file operations.
|
|
355
|
+
Manual setup wraps the standard Java I/O classes:
|
|
356
|
+
|
|
357
|
+
```kotlin
|
|
358
|
+
import io.sentry.instrumentation.file.SentryFileInputStream
|
|
359
|
+
import io.sentry.instrumentation.file.SentryFileOutputStream
|
|
360
|
+
|
|
361
|
+
// Reading
|
|
362
|
+
SentryFileInputStream(File(path)).use { input ->
|
|
363
|
+
val buffer = ByteArray(4096)
|
|
364
|
+
while (input.read(buffer) != -1) {
|
|
365
|
+
// process
|
|
366
|
+
}
|
|
367
|
+
} // span.finish() called automatically at close()
|
|
368
|
+
|
|
369
|
+
// Writing
|
|
370
|
+
SentryFileOutputStream(File(path)).use { output ->
|
|
371
|
+
output.write(data)
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Span description: `"report.pdf (512.0 kB)"` (with PII enabled) or `"***.pdf (512.0 kB)"`
|
|
376
|
+
(default).
|
|
377
|
+
|
|
378
|
+
Enable full paths via:
|
|
379
|
+
|
|
380
|
+
```kotlin
|
|
381
|
+
options.isSendDefaultPii = true
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## 10. User Interaction Tracing
|
|
387
|
+
|
|
388
|
+
Captures touch events (clicks, scrolls, swipes) as `ui.action.click` transactions.
|
|
389
|
+
Disabled by default.
|
|
390
|
+
|
|
391
|
+
```kotlin
|
|
392
|
+
options.isEnableUserInteractionTracing = true
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
Via manifest:
|
|
396
|
+
|
|
397
|
+
```xml
|
|
398
|
+
<meta-data android:name="io.sentry.traces.user-interaction.enable" android:value="true" />
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
**Views require a resource ID** for meaningful transaction names.
|
|
402
|
+
Views without IDs produce `"ActivityName.unknown_id"`.
|
|
403
|
+
|
|
404
|
+
```xml
|
|
405
|
+
<!-- Good — produces "HomeActivity.add_to_cart_button" -->
|
|
406
|
+
<Button android:id="@+id/add_to_cart_button" ... />
|
|
407
|
+
|
|
408
|
+
<!-- Bad — produces "HomeActivity.unknown_id" -->
|
|
409
|
+
<Button ... />
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Transactions auto-finish after 3 s of inactivity (configurable via
|
|
413
|
+
`options.idleTimeout`). Transactions with zero child spans are automatically discarded.
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
## 11. Slow & Frozen Frames
|
|
418
|
+
|
|
419
|
+
Automatically attached as **measurements** (not spans) to every Activity transaction.
|
|
420
|
+
No configuration needed.
|
|
421
|
+
|
|
422
|
+
| Measurement | Threshold | Meaning |
|
|
423
|
+
| --------------- | --------- | ---------------------------------------- |
|
|
424
|
+
| `frames_total` | N/A | Total frames rendered during transaction |
|
|
425
|
+
| `frames_slow` | 16–700 ms | Frames that missed the vsync budget |
|
|
426
|
+
| `frames_frozen` | > 700 ms | Frames that caused visible freezes |
|
|
427
|
+
|
|
428
|
+
Requires Android API 24 (`FrameMetricsAggregator`). Silently disabled on older devices.
|
|
429
|
+
|
|
430
|
+
These appear in Sentry’s **Mobile Vitals** section on transaction detail pages.
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## 12. Sentry Gradle Plugin — Zero-Source-Change Instrumentation
|
|
435
|
+
|
|
436
|
+
The Gradle plugin instruments bytecode at build time, enabling all tracing features with
|
|
437
|
+
**no source code changes**. Covers DATABASE, FILE_IO, OKHTTP, and COMPOSE.
|
|
438
|
+
|
|
439
|
+
```kotlin
|
|
440
|
+
// build.gradle.kts (app module)
|
|
441
|
+
plugins {
|
|
442
|
+
id("io.sentry.android.gradle") version "6.1.0"
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
sentry {
|
|
446
|
+
// Upload ProGuard/R8 mappings for de-obfuscated stack traces
|
|
447
|
+
autoUploadProguardMapping = true
|
|
448
|
+
|
|
449
|
+
// Upload native debug symbols
|
|
450
|
+
uploadNativeSymbols = false
|
|
451
|
+
includeNativeSources = false
|
|
452
|
+
|
|
453
|
+
tracingInstrumentation {
|
|
454
|
+
enabled = true
|
|
455
|
+
features = setOf(
|
|
456
|
+
InstrumentationFeature.DATABASE, // Room/SQLite auto-instrumented
|
|
457
|
+
InstrumentationFeature.FILE_IO, // FileInputStream/OutputStream
|
|
458
|
+
InstrumentationFeature.OKHTTP, // OkHttpClient.Builder.build()
|
|
459
|
+
InstrumentationFeature.COMPOSE, // rememberNavController()
|
|
460
|
+
)
|
|
461
|
+
// Exclude specific packages from instrumentation
|
|
462
|
+
excludes = setOf("com/third_party/generated/**")
|
|
463
|
+
|
|
464
|
+
// Also instrument third-party libraries (default: true)
|
|
465
|
+
forceInstrumentDependencies = true
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
> **What the plugin transforms:**
|
|
471
|
+
>
|
|
472
|
+
> - `DATABASE`: Wraps `SupportSQLiteOpenHelper.Factory` with
|
|
473
|
+
> `SentrySupportSQLiteOpenHelper`
|
|
474
|
+
> - `FILE_IO`: Rewrites `new FileInputStream(f)` → `new SentryFileInputStream(f)` at all
|
|
475
|
+
> call sites
|
|
476
|
+
> - `OKHTTP`: Injects `.addInterceptor(new SentryOkHttpInterceptor())` before every
|
|
477
|
+
> `.build()` call
|
|
478
|
+
> - `COMPOSE`: Wraps `rememberNavController()` with `.withSentryObservableEffect()`
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## 13. Custom Spans
|
|
483
|
+
|
|
484
|
+
### `Sentry.startTransaction()` — start a root transaction
|
|
485
|
+
|
|
486
|
+
```kotlin
|
|
487
|
+
import io.sentry.ITransaction
|
|
488
|
+
import io.sentry.Sentry
|
|
489
|
+
import io.sentry.SpanStatus
|
|
490
|
+
import io.sentry.TransactionOptions
|
|
491
|
+
|
|
492
|
+
// Option A: not bound to scope
|
|
493
|
+
// Auto-instrumented spans (OkHttp, SQLite) will NOT attach as children
|
|
494
|
+
val tx = Sentry.startTransaction("sync-contacts", "task")
|
|
495
|
+
try {
|
|
496
|
+
doWork()
|
|
497
|
+
tx.status = SpanStatus.OK
|
|
498
|
+
} catch (e: Exception) {
|
|
499
|
+
tx.throwable = e
|
|
500
|
+
tx.status = SpanStatus.INTERNAL_ERROR
|
|
501
|
+
throw e
|
|
502
|
+
} finally {
|
|
503
|
+
tx.finish() // MUST be called — otherwise the transaction is silently dropped
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Option B: bound to scope
|
|
507
|
+
// OkHttp, SQLite, Fragment spans from this thread attach automatically
|
|
508
|
+
val opts = TransactionOptions().apply {
|
|
509
|
+
isBindToScope = true
|
|
510
|
+
}
|
|
511
|
+
val tx = Sentry.startTransaction("checkout-flow", "ui.action", opts)
|
|
512
|
+
try {
|
|
513
|
+
placeOrder() // OkHttp and DB spans attach as children automatically
|
|
514
|
+
tx.status = SpanStatus.OK
|
|
515
|
+
} finally {
|
|
516
|
+
tx.finish()
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
Java equivalent:
|
|
521
|
+
|
|
522
|
+
```java
|
|
523
|
+
TransactionOptions opts = new TransactionOptions();
|
|
524
|
+
opts.setBindToScope(true);
|
|
525
|
+
ITransaction tx = Sentry.startTransaction("checkout-flow", "ui.action", opts);
|
|
526
|
+
try {
|
|
527
|
+
placeOrder();
|
|
528
|
+
tx.setStatus(SpanStatus.OK);
|
|
529
|
+
} finally {
|
|
530
|
+
tx.finish();
|
|
531
|
+
}
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
### `ISpan.startChild()` — add child spans
|
|
535
|
+
|
|
536
|
+
```kotlin
|
|
537
|
+
val tx = Sentry.startTransaction("data-sync", "task",
|
|
538
|
+
TransactionOptions().apply { isBindToScope = true })
|
|
539
|
+
|
|
540
|
+
// Child span with try-finally (always correct — ensures finish() is called)
|
|
541
|
+
val fetchSpan = tx.startChild("http.client", "GET /api/users")
|
|
542
|
+
try {
|
|
543
|
+
val users = apiClient.fetchUsers()
|
|
544
|
+
fetchSpan.status = SpanStatus.OK
|
|
545
|
+
} catch (e: Exception) {
|
|
546
|
+
fetchSpan.throwable = e
|
|
547
|
+
fetchSpan.status = SpanStatus.INTERNAL_ERROR
|
|
548
|
+
throw e
|
|
549
|
+
} finally {
|
|
550
|
+
fetchSpan.finish() // MUST be called
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
tx.finish()
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
### `Sentry.getSpan()` — attach to current active span
|
|
557
|
+
|
|
558
|
+
```kotlin
|
|
559
|
+
// Attach a child to whatever span is currently active
|
|
560
|
+
fun processItem(item: Item) {
|
|
561
|
+
val span = Sentry.getSpan()?.startChild("process.item", item.id)
|
|
562
|
+
try {
|
|
563
|
+
heavyProcessing(item)
|
|
564
|
+
span?.status = SpanStatus.OK
|
|
565
|
+
} finally {
|
|
566
|
+
span?.finish()
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
### Kotlin coroutines — propagate across dispatchers
|
|
572
|
+
|
|
573
|
+
Without `SentryContext`, spans started in one dispatcher won’t see the parent from
|
|
574
|
+
another.
|
|
575
|
+
|
|
576
|
+
```kotlin
|
|
577
|
+
import io.sentry.kotlin.SentryContext
|
|
578
|
+
import kotlinx.coroutines.withContext
|
|
579
|
+
|
|
580
|
+
suspend fun processOrder(orderId: String) {
|
|
581
|
+
val tx = Sentry.startTransaction("process-order", "task",
|
|
582
|
+
TransactionOptions().apply { isBindToScope = true })
|
|
583
|
+
|
|
584
|
+
// SentryContext captures the current scope and propagates it to the IO dispatcher
|
|
585
|
+
withContext(Dispatchers.IO + SentryContext()) {
|
|
586
|
+
val order = db.getOrder(orderId) // db.sql.query span attaches here
|
|
587
|
+
paymentService.charge(order) // http.client span attaches here
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
tx.status = SpanStatus.OK
|
|
591
|
+
tx.finish()
|
|
592
|
+
}
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
Dependency:
|
|
596
|
+
|
|
597
|
+
```kotlin
|
|
598
|
+
implementation("io.sentry:sentry-kotlin-extensions:8.33.0")
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
### Span data, tags, and measurements
|
|
602
|
+
|
|
603
|
+
```kotlin
|
|
604
|
+
val span = Sentry.getSpan()?.startChild("encode.video", "720p")
|
|
605
|
+
|
|
606
|
+
// Arbitrary data (visible in span detail)
|
|
607
|
+
span?.setData("codec", "h264")
|
|
608
|
+
span?.setData("input.bytes", inputFile.length())
|
|
609
|
+
span?.setData("threads", Runtime.getRuntime().availableProcessors())
|
|
610
|
+
|
|
611
|
+
// String tags (indexed, filterable)
|
|
612
|
+
span?.setTag("format", "mp4")
|
|
613
|
+
span?.setTag("quality", "720p")
|
|
614
|
+
|
|
615
|
+
// Numeric measurements with units
|
|
616
|
+
span?.setMeasurement("encode.duration_ms", durationMs)
|
|
617
|
+
span?.setMeasurement("output.size", outputFile.length(), MeasurementUnit.Information.BYTE)
|
|
618
|
+
|
|
619
|
+
span?.status = SpanStatus.OK
|
|
620
|
+
span?.finish()
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
### `SpanStatus` reference
|
|
624
|
+
|
|
625
|
+
| Status | HTTP equivalent | When to use |
|
|
626
|
+
| -------------------- | --------------- | ---------------------------- |
|
|
627
|
+
| `OK` | 2xx/3xx | Success |
|
|
628
|
+
| `CANCELLED` | 499 | Client cancelled |
|
|
629
|
+
| `INTERNAL_ERROR` | 500 | Exception / internal failure |
|
|
630
|
+
| `DEADLINE_EXCEEDED` | 504 | Timed out |
|
|
631
|
+
| `NOT_FOUND` | 404 | Resource missing |
|
|
632
|
+
| `PERMISSION_DENIED` | 403 | Auth failure |
|
|
633
|
+
| `RESOURCE_EXHAUSTED` | 429 | Rate limited |
|
|
634
|
+
| `UNAVAILABLE` | 503 | Service down |
|
|
635
|
+
| `UNKNOWN` | — | Not yet classified |
|
|
636
|
+
|
|
637
|
+
```kotlin
|
|
638
|
+
// Convenience factory from HTTP status code
|
|
639
|
+
val status = SpanStatus.fromHttpStatusCode(response.code)
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
### Idle and deadline timeouts
|
|
643
|
+
|
|
644
|
+
```kotlin
|
|
645
|
+
val opts = TransactionOptions().apply {
|
|
646
|
+
isBindToScope = true
|
|
647
|
+
isWaitForChildren = true
|
|
648
|
+
idleTimeout = 3_000L // auto-finish 3 s after last child span ends
|
|
649
|
+
deadlineTimeout = 30_000L // force-finish after 30 s regardless
|
|
650
|
+
}
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
### Hard span limit
|
|
654
|
+
|
|
655
|
+
Each transaction is capped at **1,000 child spans** (`options.maxSpans`, default
|
|
656
|
+
`1000`). Spans beyond this are silently dropped.
|
|
657
|
+
Increase if needed:
|
|
658
|
+
|
|
659
|
+
```kotlin
|
|
660
|
+
options.maxSpans = 2_000
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
---
|
|
664
|
+
|
|
665
|
+
## 14. Distributed Tracing
|
|
666
|
+
|
|
667
|
+
Connects Android traces to backend traces for end-to-end visibility.
|
|
668
|
+
|
|
669
|
+
### How it works
|
|
670
|
+
|
|
671
|
+
When a network request fires inside a transaction, the SDK attaches two headers:
|
|
672
|
+
|
|
673
|
+
| Header | Purpose |
|
|
674
|
+
| -------------- | ---------------------------------------------------- |
|
|
675
|
+
| `sentry-trace` | Trace ID, span ID, sampling decision |
|
|
676
|
+
| `baggage` | Sampling metadata (release, environment, public key) |
|
|
677
|
+
|
|
678
|
+
The backend Sentry SDK reads these headers and links its spans to the same trace.
|
|
679
|
+
|
|
680
|
+
### `tracePropagationTargets`
|
|
681
|
+
|
|
682
|
+
Controls which URLs receive the headers.
|
|
683
|
+
Default on Android: `".*"` (all URLs).
|
|
684
|
+
|
|
685
|
+
```kotlin
|
|
686
|
+
options.setTracePropagationTargets(listOf(
|
|
687
|
+
"api.myapp.com", // string — matched against full URL
|
|
688
|
+
"^https://.*\\.myapp\\.com/api/.*", // regex — also matched against full URL
|
|
689
|
+
"localhost",
|
|
690
|
+
))
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
Via manifest:
|
|
694
|
+
|
|
695
|
+
```xml
|
|
696
|
+
<meta-data
|
|
697
|
+
android:name="io.sentry.traces.trace-propagation-targets"
|
|
698
|
+
android:value="api.myapp.com,localhost" />
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
> **Security:** Remove `".*"` (the default) before going to production to avoid sending
|
|
702
|
+
> Sentry headers to third-party APIs.
|
|
703
|
+
|
|
704
|
+
### W3C `traceparent` header (SDK ≥ 8.22.0)
|
|
705
|
+
|
|
706
|
+
```kotlin
|
|
707
|
+
options.isPropagateTraceparent = true
|
|
708
|
+
// Adds: traceparent: 00-{traceId}-{spanId}-01
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
### Manual header attachment (non-OkHttp clients)
|
|
712
|
+
|
|
713
|
+
```kotlin
|
|
714
|
+
val span = Sentry.getSpan()
|
|
715
|
+
if (span != null) {
|
|
716
|
+
myRequest.header("sentry-trace", span.toSentryTrace().value)
|
|
717
|
+
span.toBaggageHeader(emptyList())?.let {
|
|
718
|
+
myRequest.header("baggage", it.value)
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
### Continuing a trace from incoming headers
|
|
724
|
+
|
|
725
|
+
```java
|
|
726
|
+
SentryTraceHeader traceHeader = new SentryTraceHeader(request.getHeader("sentry-trace"));
|
|
727
|
+
BaggageHeader baggageHeader = BaggageHeader.fromBaggageAndThirdPartyValues(
|
|
728
|
+
request.getHeader("baggage"), null
|
|
729
|
+
);
|
|
730
|
+
TransactionContext ctx = TransactionContext.fromSentryTrace(
|
|
731
|
+
"process-webhook", "task",
|
|
732
|
+
traceHeader, baggageHeader,
|
|
733
|
+
null
|
|
734
|
+
);
|
|
735
|
+
ITransaction tx = Sentry.startTransaction(ctx);
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
---
|
|
739
|
+
|
|
740
|
+
## 15. Dynamic Sampling
|
|
741
|
+
|
|
742
|
+
Use `tracesSampler` for context-aware sampling decisions instead of a uniform rate:
|
|
743
|
+
|
|
744
|
+
```kotlin
|
|
745
|
+
options.tracesSampler = TracesSamplerCallback { ctx ->
|
|
746
|
+
val name = ctx.transactionContext.name
|
|
747
|
+
when {
|
|
748
|
+
// Always trace critical flows
|
|
749
|
+
name.startsWith("Checkout") || name.startsWith("Payment") -> 1.0
|
|
750
|
+
// Never trace health checks
|
|
751
|
+
name.contains("HealthCheck") -> 0.0
|
|
752
|
+
// Respect parent sampling for distributed traces
|
|
753
|
+
ctx.transactionContext.parentSampled == true -> 1.0
|
|
754
|
+
ctx.transactionContext.parentSampled == false -> 0.0
|
|
755
|
+
// Default: 10%
|
|
756
|
+
else -> 0.1
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
Custom context (passed from `TransactionOptions`):
|
|
762
|
+
|
|
763
|
+
```kotlin
|
|
764
|
+
val opts = TransactionOptions().apply {
|
|
765
|
+
customSamplingContext = CustomSamplingContext().apply {
|
|
766
|
+
set("is_paying_user", userIsPaying)
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
val tx = Sentry.startTransaction("user-action", "task", opts)
|
|
770
|
+
|
|
771
|
+
// In the sampler:
|
|
772
|
+
options.tracesSampler = TracesSamplerCallback { ctx ->
|
|
773
|
+
if (ctx.customSamplingContext["is_paying_user"] == true) 1.0 else 0.1
|
|
774
|
+
}
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
---
|
|
778
|
+
|
|
779
|
+
## 16. Configuration Reference
|
|
780
|
+
|
|
781
|
+
### `SentryAndroid.init()` — tracing options
|
|
782
|
+
|
|
783
|
+
```kotlin
|
|
784
|
+
SentryAndroid.init(this) { options ->
|
|
785
|
+
// ── Sampling ─────────────────────────────────────────────────────────
|
|
786
|
+
options.tracesSampleRate = 0.2
|
|
787
|
+
// options.tracesSampler = TracesSamplerCallback { ctx -> 0.1 }
|
|
788
|
+
|
|
789
|
+
// ── Activity tracing ─────────────────────────────────────────────────
|
|
790
|
+
options.isEnableAutoActivityLifecycleTracing = true // default
|
|
791
|
+
options.isEnableActivityLifecycleTracingAutoFinish = true // default
|
|
792
|
+
options.isEnableTimeToFullDisplayTracing = false // opt-in
|
|
793
|
+
|
|
794
|
+
// ── User interactions ────────────────────────────────────────────────
|
|
795
|
+
options.isEnableUserInteractionTracing = false // opt-in
|
|
796
|
+
|
|
797
|
+
// ── Frame tracking ───────────────────────────────────────────────────
|
|
798
|
+
options.isEnableFramesTracking = true // default (API 24+)
|
|
799
|
+
|
|
800
|
+
// ── Transaction timeouts ─────────────────────────────────────────────
|
|
801
|
+
options.idleTimeout = 3_000L // ms
|
|
802
|
+
options.deadlineTimeout = 30_000L // ms
|
|
803
|
+
options.maxSpans = 1_000 // per transaction
|
|
804
|
+
|
|
805
|
+
// ── Distributed tracing ──────────────────────────────────────────────
|
|
806
|
+
options.setTracePropagationTargets(listOf("api.myapp.com"))
|
|
807
|
+
options.isPropagateTraceparent = false
|
|
808
|
+
}
|
|
809
|
+
```
|
|
810
|
+
|
|
811
|
+
### `AndroidManifest.xml` — tracing keys
|
|
812
|
+
|
|
813
|
+
| Key | Type | Default | Description |
|
|
814
|
+
| ---------------------------------------------- | ------------ | ------- | ---------------------------------- |
|
|
815
|
+
| `io.sentry.traces.sample-rate` | Float | `null` | Traces sample rate 0.0–1.0 |
|
|
816
|
+
| `io.sentry.traces.activity.enable` | Boolean | `true` | Activity lifecycle tracing |
|
|
817
|
+
| `io.sentry.traces.activity.auto-finish.enable` | Boolean | `true` | Auto-finish Activity transactions |
|
|
818
|
+
| `io.sentry.traces.time-to-full-display.enable` | Boolean | `false` | TTFD tracking |
|
|
819
|
+
| `io.sentry.traces.user-interaction.enable` | Boolean | `false` | Gesture/click tracing |
|
|
820
|
+
| `io.sentry.traces.frames-tracking` | Boolean | `true` | Slow/frozen frame tracking |
|
|
821
|
+
| `io.sentry.traces.idle-timeout` | Long (ms) | `3000` | Idle transaction auto-finish delay |
|
|
822
|
+
| `io.sentry.traces.deadline-timeout` | Long (ms) | `30000` | Force-finish deadline |
|
|
823
|
+
| `io.sentry.traces.trace-propagation-targets` | String (CSV) | `".*"` | URLs that receive trace headers |
|
|
824
|
+
|
|
825
|
+
### Instrumentation approach comparison
|
|
826
|
+
|
|
827
|
+
| Feature | Enabled by default | Required setup | Source changes? | Gradle Plugin? |
|
|
828
|
+
| -------------------------- | ------------------ | ----------------------------------- | --------------- | -------------- |
|
|
829
|
+
| Activity `ui.load` + TTID | ✅ | None | No | No |
|
|
830
|
+
| TTFD | ❌ | Manifest + `reportFullyDisplayed()` | 1 call | No |
|
|
831
|
+
| Fragment spans | ❌ | `addIntegration()` | No | No |
|
|
832
|
+
| OkHttp spans | ❌ | Add to builder | Yes | Optional |
|
|
833
|
+
| OkHttp sub-spans (DNS/TLS) | ❌ | Add `SentryOkHttpEventListener` | Yes | Optional |
|
|
834
|
+
| SQLite / Room | ❌ | Wrap factory | Yes | Optional |
|
|
835
|
+
| Compose navigation | ❌ | `.withSentryObservableEffect()` | Yes | Optional |
|
|
836
|
+
| File I/O | ❌ | Use `Sentry*` wrappers | Yes | Optional |
|
|
837
|
+
| User interaction | ❌ | Manifest flag | No | No |
|
|
838
|
+
| Slow/frozen frames | ✅ | None (API 24+) | No | No |
|
|
839
|
+
| **All above (plugin)** | N/A | Apply Gradle plugin | **No** | **Yes** |
|
|
840
|
+
|
|
841
|
+
---
|
|
842
|
+
|
|
843
|
+
## 17. Troubleshooting
|
|
844
|
+
|
|
845
|
+
| Issue | Cause | Solution |
|
|
846
|
+
| ------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
847
|
+
| No transactions in Sentry | `tracesSampleRate` not set or `0` | Set `tracesSampleRate > 0` |
|
|
848
|
+
| OkHttp spans missing | Interceptor not added | Add `SentryOkHttpInterceptor()` to `OkHttpClient.Builder` or apply Gradle plugin with `OKHTTP` feature |
|
|
849
|
+
| SQLite spans missing | Factory not wrapped | Use `SentrySupportSQLiteOpenHelper.Factory` or apply Gradle plugin with `DATABASE` feature |
|
|
850
|
+
| Fragment spans missing | No scope-bound parent transaction | Ensure the Activity transaction uses `isBindToScope = true` (it does by default for auto-instrumented transactions) |
|
|
851
|
+
| Child spans missing from custom transaction | `isBindToScope = false` | Set `TransactionOptions().isBindToScope = true` when starting a custom transaction |
|
|
852
|
+
| TTFD span shows `DEADLINE_EXCEEDED` | `reportFullyDisplayed()` not called within 25 s | Call `Sentry.reportFullyDisplayed()` when your async content finishes loading |
|
|
853
|
+
| TTID missing | Activity tracing disabled | Ensure `isEnableAutoActivityLifecycleTracing = true` (default) |
|
|
854
|
+
| App Start span missing | Not appearing correctly | App start appears as first child of first Activity `ui.load` transaction; verify Activity tracing is enabled |
|
|
855
|
+
| Slow/frozen frames not appearing | API < 24 or disabled | Requires Android 7.0+ (`FrameMetricsAggregator`); check `isEnableFramesTracking = true` |
|
|
856
|
+
| User interaction transactions missing | Views have no `android:id` | Add resource IDs to interactive views |
|
|
857
|
+
| `sentry-trace` header missing from OkHttp | `tracePropagationTargets` doesn’t match URL | Check full URL against your patterns — matched against the entire URL string |
|
|
858
|
+
| Coroutine spans not linked | Missing `SentryContext` | Add `+ SentryContext()` to `withContext(Dispatchers.IO + SentryContext())` |
|
|
859
|
+
| Transaction never finishes | Idle timeout not reached | Verify `isWaitForChildren = true` and adjust `idleTimeout`; always call `tx.finish()` in `finally` |
|
|
860
|
+
| Spans silently dropped | Hit 1,000-span limit | Increase `options.maxSpans` or reduce instrumentation scope |
|
|
861
|
+
| Compose navigation spans missing | `COMPOSE` plugin feature not applied | Apply Gradle plugin with `InstrumentationFeature.COMPOSE` or call `.withSentryObservableEffect()` manually |
|