@danieljvdm/dev-kit 1.0.1 → 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 +6 -29
- package/skill-sources.lock.json +23 -109
- 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 +11 -115
- package/skills/open-pull-request/agents/openai.yaml +3 -3
- 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,288 @@
|
|
|
1
|
+
# Metrics — Sentry Android SDK
|
|
2
|
+
|
|
3
|
+
> **Minimum SDK:** `io.sentry:sentry-android:8.30.0`\
|
|
4
|
+
> **Enabled by default:** Yes — no opt-in required\
|
|
5
|
+
> **Docs:** https://docs.sentry.io/platforms/android/metrics/
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Sentry Metrics lets you track counters, distributions, and gauges from your Android app.
|
|
12
|
+
Metrics are sent to Sentry and appear in the **Metrics** tab where you can create charts
|
|
13
|
+
and alerts.
|
|
14
|
+
|
|
15
|
+
> **No Set metric type.** Unlike some observability platforms, this SDK does **not**
|
|
16
|
+
> have a `set()` method for tracking unique values.
|
|
17
|
+
> Only **Counter**, **Distribution**, and **Gauge** are available.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
Metrics is enabled by default.
|
|
24
|
+
To disable or add filtering:
|
|
25
|
+
|
|
26
|
+
```kotlin
|
|
27
|
+
SentryAndroid.init(this) { options ->
|
|
28
|
+
// Disable metrics entirely
|
|
29
|
+
options.metrics.setEnabled(false)
|
|
30
|
+
|
|
31
|
+
// Or filter metrics before they are sent
|
|
32
|
+
options.metrics.setBeforeSend { metric, _ ->
|
|
33
|
+
// Drop debug-prefixed metrics in production
|
|
34
|
+
if (!BuildConfig.DEBUG && metric.name.startsWith("debug.")) {
|
|
35
|
+
return@setBeforeSend null // null = drop the metric
|
|
36
|
+
}
|
|
37
|
+
metric
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Via AndroidManifest.xml:**
|
|
43
|
+
|
|
44
|
+
```xml
|
|
45
|
+
<meta-data android:name="io.sentry.metrics.enabled" android:value="false" />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Configuration Reference
|
|
49
|
+
|
|
50
|
+
| Option | Type | Default | Description |
|
|
51
|
+
| ----------------------- | --------------------------- | ------- | -------------------------------------------------------------------- |
|
|
52
|
+
| `metrics.isEnabled` | `Boolean` | `true` | Master switch — metrics are ON by default |
|
|
53
|
+
| `metrics.setBeforeSend` | `BeforeSendMetricCallback?` | `null` | Filter or mutate metrics before transmission. Return `null` to drop. |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Code Examples
|
|
58
|
+
|
|
59
|
+
### Counter
|
|
60
|
+
|
|
61
|
+
Track how many times something happens.
|
|
62
|
+
Default increment is `1.0`.
|
|
63
|
+
|
|
64
|
+
```kotlin
|
|
65
|
+
import io.sentry.Sentry
|
|
66
|
+
import io.sentry.metrics.MetricsUnit
|
|
67
|
+
import io.sentry.metrics.SentryMetricsParameters
|
|
68
|
+
import io.sentry.SentryAttribute
|
|
69
|
+
import io.sentry.SentryAttributes
|
|
70
|
+
|
|
71
|
+
// Simple event count
|
|
72
|
+
Sentry.metrics().count("ui.button_tap")
|
|
73
|
+
|
|
74
|
+
// With explicit increment value
|
|
75
|
+
Sentry.metrics().count("feature.items_processed", 25.0)
|
|
76
|
+
|
|
77
|
+
// With unit
|
|
78
|
+
Sentry.metrics().count("network.bytes_sent", 8_192.0, MetricsUnit.Information.BYTE)
|
|
79
|
+
|
|
80
|
+
// With attributes (custom dimensions for filtering/grouping)
|
|
81
|
+
Sentry.metrics().count(
|
|
82
|
+
"feature.used",
|
|
83
|
+
1.0,
|
|
84
|
+
null, // no unit for dimensionless counters
|
|
85
|
+
SentryMetricsParameters.create(
|
|
86
|
+
SentryAttributes.of(
|
|
87
|
+
SentryAttribute.stringAttribute("feature", "dark_mode"),
|
|
88
|
+
SentryAttribute.stringAttribute("user_tier", "premium")
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Distribution
|
|
95
|
+
|
|
96
|
+
Record individual measurements — each call adds one data point to a histogram.
|
|
97
|
+
Use for durations, sizes, and similar measurements.
|
|
98
|
+
|
|
99
|
+
```kotlin
|
|
100
|
+
// Response time
|
|
101
|
+
Sentry.metrics().distribution("api.response_time", 187.5, MetricsUnit.Duration.MILLISECOND)
|
|
102
|
+
|
|
103
|
+
// File size
|
|
104
|
+
Sentry.metrics().distribution("image.upload_size", fileBytes.toDouble(), MetricsUnit.Information.BYTE)
|
|
105
|
+
|
|
106
|
+
// With attributes
|
|
107
|
+
Sentry.metrics().distribution(
|
|
108
|
+
"api.response_time",
|
|
109
|
+
elapsed.toDouble(),
|
|
110
|
+
MetricsUnit.Duration.MILLISECOND,
|
|
111
|
+
SentryMetricsParameters.create(
|
|
112
|
+
SentryAttributes.of(
|
|
113
|
+
SentryAttribute.stringAttribute("endpoint", "/api/v2/users"),
|
|
114
|
+
SentryAttribute.stringAttribute("http.method", "GET"),
|
|
115
|
+
SentryAttribute.integerAttribute("http.status", responseCode)
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Gauge
|
|
122
|
+
|
|
123
|
+
Capture a point-in-time snapshot of a value that can go up or down.
|
|
124
|
+
Use for current levels, queue depths, and resource utilization.
|
|
125
|
+
|
|
126
|
+
```kotlin
|
|
127
|
+
// Active downloads
|
|
128
|
+
Sentry.metrics().gauge("app.active_downloads", activeDownloads.toDouble())
|
|
129
|
+
|
|
130
|
+
// Memory usage
|
|
131
|
+
val usedMemory = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1_048_576.0
|
|
132
|
+
Sentry.metrics().gauge("app.memory_used_mb", usedMemory)
|
|
133
|
+
|
|
134
|
+
// Queue depth
|
|
135
|
+
Sentry.metrics().gauge("queue.pending_tasks", pendingTasks.toDouble())
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Backfilling with Custom Timestamp
|
|
139
|
+
|
|
140
|
+
```kotlin
|
|
141
|
+
Sentry.metrics().distribution(
|
|
142
|
+
"checkout.duration",
|
|
143
|
+
checkoutDurationMs.toDouble(),
|
|
144
|
+
MetricsUnit.Duration.MILLISECOND,
|
|
145
|
+
SentryMetricsParameters.create(
|
|
146
|
+
SentryAutoDateProvider().now(), // custom timestamp
|
|
147
|
+
SentryAttributes.of(
|
|
148
|
+
SentryAttribute.stringAttribute("payment_method", "card"),
|
|
149
|
+
SentryAttribute.booleanAttribute("coupon_applied", true)
|
|
150
|
+
)
|
|
151
|
+
)
|
|
152
|
+
)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Practical Example — Tracking Checkout Flow
|
|
156
|
+
|
|
157
|
+
```kotlin
|
|
158
|
+
class CheckoutViewModel : ViewModel() {
|
|
159
|
+
|
|
160
|
+
fun checkout(cart: Cart) {
|
|
161
|
+
val t0 = SystemClock.elapsedRealtime()
|
|
162
|
+
|
|
163
|
+
viewModelScope.launch {
|
|
164
|
+
try {
|
|
165
|
+
val order = repository.submitOrder(cart)
|
|
166
|
+
|
|
167
|
+
// Count successful checkouts
|
|
168
|
+
Sentry.metrics().count(
|
|
169
|
+
"checkout.success",
|
|
170
|
+
1.0,
|
|
171
|
+
null,
|
|
172
|
+
SentryMetricsParameters.create(
|
|
173
|
+
SentryAttributes.of(
|
|
174
|
+
SentryAttribute.stringAttribute("payment_method", cart.paymentMethod),
|
|
175
|
+
SentryAttribute.integerAttribute("item_count", cart.items.size)
|
|
176
|
+
)
|
|
177
|
+
)
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
// Record checkout duration
|
|
181
|
+
Sentry.metrics().distribution(
|
|
182
|
+
"checkout.duration",
|
|
183
|
+
(SystemClock.elapsedRealtime() - t0).toDouble(),
|
|
184
|
+
MetricsUnit.Duration.MILLISECOND
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
// Record order value
|
|
188
|
+
Sentry.metrics().distribution("order.value_usd", cart.totalUsd)
|
|
189
|
+
|
|
190
|
+
} catch (e: Exception) {
|
|
191
|
+
Sentry.metrics().count("checkout.failure")
|
|
192
|
+
throw e
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Units Reference — `MetricsUnit`
|
|
202
|
+
|
|
203
|
+
Use `MetricsUnit` constants for well-known units.
|
|
204
|
+
Pass `null` for dimensionless values.
|
|
205
|
+
|
|
206
|
+
> **Custom unit strings are not supported.** Only `MetricsUnit.*` constants produce
|
|
207
|
+
> correct rendering in the Sentry UI. Passing an arbitrary string (e.g., `"frames"`) is
|
|
208
|
+
> accepted but displays incorrectly.
|
|
209
|
+
|
|
210
|
+
**Duration:**
|
|
211
|
+
|
|
212
|
+
```kotlin
|
|
213
|
+
MetricsUnit.Duration.NANOSECOND
|
|
214
|
+
MetricsUnit.Duration.MICROSECOND
|
|
215
|
+
MetricsUnit.Duration.MILLISECOND // most common for Android
|
|
216
|
+
MetricsUnit.Duration.SECOND
|
|
217
|
+
MetricsUnit.Duration.MINUTE
|
|
218
|
+
MetricsUnit.Duration.HOUR
|
|
219
|
+
MetricsUnit.Duration.DAY
|
|
220
|
+
MetricsUnit.Duration.WEEK
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Information (data size):**
|
|
224
|
+
|
|
225
|
+
```kotlin
|
|
226
|
+
MetricsUnit.Information.BYTE
|
|
227
|
+
MetricsUnit.Information.KILOBYTE
|
|
228
|
+
MetricsUnit.Information.KIBIBYTE
|
|
229
|
+
MetricsUnit.Information.MEGABYTE
|
|
230
|
+
MetricsUnit.Information.MEBIBYTE
|
|
231
|
+
MetricsUnit.Information.GIGABYTE
|
|
232
|
+
MetricsUnit.Information.GIBIBYTE
|
|
233
|
+
MetricsUnit.Information.TERABYTE
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Fraction:**
|
|
237
|
+
|
|
238
|
+
```kotlin
|
|
239
|
+
MetricsUnit.Fraction.RATIO // 0.0 to 1.0
|
|
240
|
+
MetricsUnit.Fraction.PERCENT // 0.0 to 100.0
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Batch Processing
|
|
246
|
+
|
|
247
|
+
Metrics are batched and sent asynchronously:
|
|
248
|
+
|
|
249
|
+
| Parameter | Value |
|
|
250
|
+
| ---------------- | -------------------------------------------------------------------------- |
|
|
251
|
+
| Flush delay | 5 seconds after the first queued event |
|
|
252
|
+
| Max batch size | 1,000 metrics per HTTP envelope |
|
|
253
|
+
| Max queue size | 10,000 metrics (above this, new metrics are silently dropped) |
|
|
254
|
+
| Background flush | Yes — `AndroidMetricsBatchProcessor` flushes immediately on app background |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Best Practices
|
|
259
|
+
|
|
260
|
+
1. **Use consistent key names** — metric names should be `snake_case.namespaced`, e.g.
|
|
261
|
+
`checkout.duration` not `checkoutDuration`
|
|
262
|
+
2. **Use `MetricsUnit.*` constants** — custom strings render incorrectly in the UI
|
|
263
|
+
3. **Pass `null` unit for dimensionless metrics** — don’t leave unit as an empty string
|
|
264
|
+
4. **Use attributes for dimensions** — prefer
|
|
265
|
+
`Sentry.metrics().count("api.call", 1.0, null, paramsWithEndpointAttr)` over separate
|
|
266
|
+
metric keys per endpoint
|
|
267
|
+
5. **Use `beforeSend` to drop debug metrics in production** — avoids quota usage and
|
|
268
|
+
noise
|
|
269
|
+
6. **Counter vs. Distribution** — use Counter for event occurrences (how many times),
|
|
270
|
+
Distribution for measurements (how long, how large)
|
|
271
|
+
7. **Gauge for instantaneous state** — gauges are best for values that fluctuate: queue
|
|
272
|
+
depth, connection pool size, active sessions
|
|
273
|
+
8. **Avoid high-cardinality attribute values** — user IDs, UUIDs, or timestamps as
|
|
274
|
+
attribute values create unbounded series in the Sentry backend
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Troubleshooting
|
|
279
|
+
|
|
280
|
+
| Issue | Solution |
|
|
281
|
+
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
282
|
+
| Metrics not appearing in Sentry | Verify SDK ≥ 8.30.0; check that metrics were not disabled via `options.metrics.setEnabled(false)` or manifest `io.sentry.metrics.enabled = false` |
|
|
283
|
+
| `set()` method not found | The Set type does not exist in this SDK — only Counter, Distribution, and Gauge are available |
|
|
284
|
+
| Metrics silently dropped | Queue is capped at 10,000 events; use `beforeSend` to filter high-volume metrics |
|
|
285
|
+
| Unit renders incorrectly in Sentry UI | Only `MetricsUnit.*` constants are supported; passing arbitrary strings is not |
|
|
286
|
+
| `beforeSend` dropping too many metrics | Ensure the return is `metric` (not `null`) for events you want to keep; a null return drops the event |
|
|
287
|
+
| Metrics data delayed by ~5s | Expected — the batch processor holds events for 5 seconds before flushing |
|
|
288
|
+
| High memory on metrics-heavy screens | Metrics are in-memory until flushed; avoid extremely high burst rates on low-memory devices |
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
# Profiling — Sentry Android SDK
|
|
2
|
+
|
|
3
|
+
> **Minimum SDK:** `io.sentry:sentry-android` ≥ 7.0.0 for transaction-based profiling
|
|
4
|
+
> `io.sentry:sentry-android` ≥ 8.7.0 for continuous/UI profiling (recommended)
|
|
5
|
+
> **Requirement:** Profiling requires tracing to be enabled.
|
|
6
|
+
> Only transactions sampled for tracing can be profiled.
|
|
7
|
+
> **Platform requirement:** Android API 22+ (silently disabled on older devices)
|
|
8
|
+
|
|
9
|
+
Android profiling samples the call stack at ~101 Hz using
|
|
10
|
+
`Debug.startMethodTracingSampling()` to surface hot code paths and slow functions.
|
|
11
|
+
Profiles are attached to transactions and visible as flame graphs in Sentry.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Table of Contents
|
|
16
|
+
|
|
17
|
+
1. [How Profiling Works](#1-how-profiling-works)
|
|
18
|
+
2. [Continuous / UI Profiling (Recommended)](#2-continuous--ui-profiling-recommended)
|
|
19
|
+
3. [Transaction-Based Profiling (Legacy)](#3-transaction-based-profiling-legacy)
|
|
20
|
+
4. [Choosing a Mode](#4-choosing-a-mode)
|
|
21
|
+
5. [What Data Is Captured](#5-what-data-is-captured)
|
|
22
|
+
6. [Performance Overhead](#6-performance-overhead)
|
|
23
|
+
7. [Configuration Reference](#7-configuration-reference)
|
|
24
|
+
8. [Known Limitations](#8-known-limitations)
|
|
25
|
+
9. [Troubleshooting](#9-troubleshooting)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 1. How Profiling Works
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Transaction starts (sampled)
|
|
33
|
+
│
|
|
34
|
+
├── Profiler starts: Debug.startMethodTracingSampling(file, 3MB, ~9901 μs)
|
|
35
|
+
│ ├── Samples JS/Kotlin/Java call stack at ~101 Hz
|
|
36
|
+
│ └── Writes binary trace to local file
|
|
37
|
+
│
|
|
38
|
+
├── Transaction body executes
|
|
39
|
+
│ ├── Your code: Kotlin/Java frames
|
|
40
|
+
│ ├── Auto-instrumented spans (OkHttp, SQLite, etc.)
|
|
41
|
+
│ └── Collected: frames_slow, frames_frozen, screen_frame_rate
|
|
42
|
+
│
|
|
43
|
+
└── Transaction finishes
|
|
44
|
+
├── Profiler stops: Debug.stopMethodTracing()
|
|
45
|
+
├── Profile data deserialized into ProfilingTraceData
|
|
46
|
+
└── Attached to transaction envelope → uploaded to Sentry
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Sampling relationship
|
|
50
|
+
|
|
51
|
+
`profilesSampleRate` is **relative to `tracesSampleRate`** — not to all transactions:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
All transactions
|
|
55
|
+
└─ × tracesSampleRate → Traced transactions
|
|
56
|
+
└─ × profilesSampleRate → Profiled transactions
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Example: `tracesSampleRate = 0.2` + `profilesSampleRate = 0.5` → 10% of all transactions
|
|
60
|
+
are profiled.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 2. Continuous / UI Profiling (Recommended)
|
|
65
|
+
|
|
66
|
+
Available since SDK 8.7.0. Profiles the entire app session (or only during active
|
|
67
|
+
traces) rather than individual transactions.
|
|
68
|
+
No 30-second hard cap.
|
|
69
|
+
|
|
70
|
+
### Setup
|
|
71
|
+
|
|
72
|
+
```kotlin
|
|
73
|
+
import io.sentry.ProfileLifecycle
|
|
74
|
+
import io.sentry.android.core.SentryAndroid
|
|
75
|
+
|
|
76
|
+
SentryAndroid.init(this) { options ->
|
|
77
|
+
options.dsn = "YOUR_DSN"
|
|
78
|
+
|
|
79
|
+
// Tracing is required for TRACE lifecycle; optional for MANUAL
|
|
80
|
+
options.tracesSampleRate = 1.0
|
|
81
|
+
|
|
82
|
+
// Fraction of app sessions to profile continuously (evaluated once per session)
|
|
83
|
+
// 1.0 = all sessions — development/testing only
|
|
84
|
+
options.profileSessionSampleRate = 1.0
|
|
85
|
+
|
|
86
|
+
// TRACE: profile starts/stops automatically with root spans
|
|
87
|
+
// MANUAL: you call Sentry.startProfiler() / Sentry.stopProfiler()
|
|
88
|
+
options.profileLifecycle = ProfileLifecycle.TRACE
|
|
89
|
+
|
|
90
|
+
// MANUAL lifecycle only: start profiling from the very first frame
|
|
91
|
+
// options.isProfilingStartOnAppStart = true
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### `TRACE` lifecycle
|
|
96
|
+
|
|
97
|
+
Profiler starts automatically when the first **sampled root span** begins, and stops
|
|
98
|
+
when all root spans finish.
|
|
99
|
+
No code changes needed beyond the options above.
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
App launches
|
|
103
|
+
└─ First traced transaction starts → profiler starts
|
|
104
|
+
├─ Activity load transaction
|
|
105
|
+
├─ User taps → another transaction
|
|
106
|
+
└─ All transactions finish → profiler stops
|
|
107
|
+
└─ Profile chunks emitted every 60 s
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### `MANUAL` lifecycle
|
|
111
|
+
|
|
112
|
+
You control start/stop explicitly.
|
|
113
|
+
Does **not** require tracing.
|
|
114
|
+
|
|
115
|
+
```kotlin
|
|
116
|
+
import io.sentry.Sentry
|
|
117
|
+
|
|
118
|
+
// @ApiStatus.Experimental — API may change
|
|
119
|
+
Sentry.startProfiler()
|
|
120
|
+
|
|
121
|
+
// ... do work you want to profile ...
|
|
122
|
+
|
|
123
|
+
Sentry.stopProfiler()
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
> **Note:** `startProfiler()` and `stopProfiler()` are `@ApiStatus.Experimental`. Pin
|
|
127
|
+
> your SDK version if API stability matters.
|
|
128
|
+
|
|
129
|
+
### Profile chunks
|
|
130
|
+
|
|
131
|
+
Continuous profiling emits profile data in 60-second rolling chunks.
|
|
132
|
+
Each chunk is a separate envelope item correlated to active transactions via
|
|
133
|
+
`profilerId`:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
Session start → profilerId generated (shared across all chunks)
|
|
137
|
+
Every 60 s → ProfileChunk(profilerId, chunkId, frames) uploaded
|
|
138
|
+
Each transaction → contexts.profile.profiler_id = profilerId (links tx → profile)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 3. Transaction-Based Profiling (Legacy)
|
|
144
|
+
|
|
145
|
+
Available since SDK 7.0.0. Profiles are scoped to individual sampled transactions with a
|
|
146
|
+
30-second hard cap.
|
|
147
|
+
|
|
148
|
+
### Setup
|
|
149
|
+
|
|
150
|
+
```kotlin
|
|
151
|
+
SentryAndroid.init(this) { options ->
|
|
152
|
+
options.dsn = "YOUR_DSN"
|
|
153
|
+
|
|
154
|
+
// Both must be set — profiling is relative to tracing
|
|
155
|
+
options.tracesSampleRate = 1.0
|
|
156
|
+
options.profilesSampleRate = 1.0 // 1.0 = profile all traced transactions
|
|
157
|
+
|
|
158
|
+
// Or: dynamic profiling sampler
|
|
159
|
+
// options.profilesSampler = ProfilesSamplerCallback { ctx ->
|
|
160
|
+
// if (ctx.transactionContext.name.contains("Checkout")) 1.0 else 0.1
|
|
161
|
+
// }
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Java equivalent:
|
|
166
|
+
|
|
167
|
+
```java
|
|
168
|
+
options.setTracesSampleRate(1.0);
|
|
169
|
+
options.setProfilesSampleRate(1.0);
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 30-second hard cap
|
|
173
|
+
|
|
174
|
+
Transaction profiling uses `Debug.startMethodTracingSampling()` which is limited to 30
|
|
175
|
+
seconds. Profiles for transactions longer than 30 s are automatically truncated:
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
Android SDK constants:
|
|
179
|
+
BUFFER_SIZE_BYTES = 3_000_000 (3 MB ring buffer)
|
|
180
|
+
PROFILING_TIMEOUT_MILLIS = 30_000 (30 s hard cap)
|
|
181
|
+
Sampling interval ≈ 9,901 μs (101 Hz)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
> **This is the primary reason to prefer continuous profiling.** Transactions that
|
|
185
|
+
> exceed 30 s (e.g., long-running background work) have incomplete profiles in the
|
|
186
|
+
> transaction-based mode.
|
|
187
|
+
|
|
188
|
+
### Mutual exclusivity
|
|
189
|
+
|
|
190
|
+
Setting `profilesSampleRate` (even to `0.0`) disables continuous profiling.
|
|
191
|
+
The two modes cannot be used simultaneously:
|
|
192
|
+
|
|
193
|
+
```kotlin
|
|
194
|
+
// ✅ Continuous profiling only
|
|
195
|
+
options.profileSessionSampleRate = 0.5 // set this
|
|
196
|
+
// options.profilesSampleRate not set
|
|
197
|
+
|
|
198
|
+
// ✅ Transaction profiling only (legacy)
|
|
199
|
+
options.profilesSampleRate = 0.5 // set this
|
|
200
|
+
// options.profileSessionSampleRate not set
|
|
201
|
+
|
|
202
|
+
// ❌ Both set — continuous profiling silently disabled
|
|
203
|
+
options.profilesSampleRate = 0.5
|
|
204
|
+
options.profileSessionSampleRate = 0.5 // ignored
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 4. Choosing a Mode
|
|
210
|
+
|
|
211
|
+
| | Continuous / UI Profiling | Transaction-Based (Legacy) |
|
|
212
|
+
| ---------------------- | --------------------------------------------- | ---------------------------------------- |
|
|
213
|
+
| **SDK version** | ≥ 8.7.0 | ≥ 7.0.0 |
|
|
214
|
+
| **Duration limit** | None (60 s chunks) | 30 s hard cap |
|
|
215
|
+
| **Tracing required** | `TRACE` lifecycle: yes. `MANUAL`: no | Yes |
|
|
216
|
+
| **Overhead** | Higher (always sampling) | Lower (transaction-gated) |
|
|
217
|
+
| **Recommended for** | All new projects | Existing projects not yet on 8.7+ |
|
|
218
|
+
| **App start coverage** | ✅ `isProfilingStartOnAppStart = true` | ❌ Profile starts with first transaction |
|
|
219
|
+
| **API stability** | `startProfiler/stopProfiler` are experimental | Stable |
|
|
220
|
+
|
|
221
|
+
**Choose continuous profiling** unless you are constrained to SDK < 8.7.0 or need to
|
|
222
|
+
minimize profiling overhead on low-end devices.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 5. What Data Is Captured
|
|
227
|
+
|
|
228
|
+
### In a profile
|
|
229
|
+
|
|
230
|
+
| Data | Description |
|
|
231
|
+
| ---------------------- | --------------------------------------------------- |
|
|
232
|
+
| **Call stack samples** | Java/Kotlin stack frames sampled at ~101 Hz |
|
|
233
|
+
| **Flame graph** | Aggregated time-per-function view |
|
|
234
|
+
| **Timeline** | Stack samples correlated with transaction spans |
|
|
235
|
+
| **Thread info** | Main thread, background threads, system threads |
|
|
236
|
+
| **Frame metrics** | `frames_slow`, `frames_frozen`, `screen_frame_rate` |
|
|
237
|
+
| **Function names** | Readable names require ProGuard mapping upload |
|
|
238
|
+
|
|
239
|
+
### What profiles are linked to
|
|
240
|
+
|
|
241
|
+
Each profile chunk (continuous) or profile (transaction-based) is correlated with
|
|
242
|
+
transactions via `profilerId`. In the Sentry UI you can:
|
|
243
|
+
|
|
244
|
+
- View flame graph alongside the transaction’s span waterfall
|
|
245
|
+
- Identify which functions executed during slow spans
|
|
246
|
+
- Click from a slow span to the corresponding stack samples
|
|
247
|
+
|
|
248
|
+
### What is NOT captured
|
|
249
|
+
|
|
250
|
+
- Memory allocations (use Android Studio Memory Profiler)
|
|
251
|
+
- Network traffic details (captured separately by OkHttp spans)
|
|
252
|
+
- GPU rendering details (slow/frozen frames are a separate measurement)
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 6. Performance Overhead
|
|
257
|
+
|
|
258
|
+
Profiling adds CPU overhead.
|
|
259
|
+
`Debug.startMethodTracingSampling()` uses sampling (not full instrumentation), which
|
|
260
|
+
keeps overhead lower than full instrumentation profilers.
|
|
261
|
+
|
|
262
|
+
| Factor | Impact |
|
|
263
|
+
| ----------------------------------- | -------------------------------------------------------- |
|
|
264
|
+
| Transaction-based profiling | Low-medium — only active during traced transactions |
|
|
265
|
+
| Continuous (`TRACE` lifecycle) | Medium — always running while any transaction is active |
|
|
266
|
+
| Continuous (`MANUAL` lifecycle) | Higher — runs from `startProfiler()` to `stopProfiler()` |
|
|
267
|
+
| Low-end Android devices (< 4GB RAM) | More significant — test on representative devices |
|
|
268
|
+
|
|
269
|
+
**Recommendations:**
|
|
270
|
+
|
|
271
|
+
- Use `profilesSampleRate = 1.0` or `profileSessionSampleRate = 1.0` **only** in
|
|
272
|
+
development/testing
|
|
273
|
+
- In production: keep `profilesSampleRate ≤ 0.1` or `profileSessionSampleRate ≤ 0.1`
|
|
274
|
+
- On low-end devices: reduce to `0.01`–`0.05`
|
|
275
|
+
- Use `TRACE` lifecycle instead of `MANUAL` to gate profiling to active transactions
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 7. Configuration Reference
|
|
280
|
+
|
|
281
|
+
### `SentryAndroid.init()` — profiling options
|
|
282
|
+
|
|
283
|
+
```kotlin
|
|
284
|
+
SentryAndroid.init(this) { options ->
|
|
285
|
+
// ── Required: tracing ────────────────────────────────────────────────
|
|
286
|
+
options.tracesSampleRate = 0.2 // required for TRACE lifecycle and transaction profiling
|
|
287
|
+
|
|
288
|
+
// ── Continuous profiling (recommended, SDK ≥ 8.7.0) ──────────────────
|
|
289
|
+
options.profileSessionSampleRate = 0.1 // 10% of sessions profiled
|
|
290
|
+
options.profileLifecycle = ProfileLifecycle.TRACE // or MANUAL
|
|
291
|
+
options.isProfilingStartOnAppStart = false // MANUAL only: start from first frame
|
|
292
|
+
|
|
293
|
+
// ── Transaction-based profiling (legacy) ──────────────────────────────
|
|
294
|
+
// options.profilesSampleRate = 0.1 // mutually exclusive with continuous
|
|
295
|
+
// options.profilesSampler = ProfilesSamplerCallback { ctx -> 0.1 }
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### `AndroidManifest.xml` — profiling keys
|
|
300
|
+
|
|
301
|
+
| Key | Type | Default | Description |
|
|
302
|
+
| ------------------------------------------------ | ------- | ---------- | ----------------------------------- |
|
|
303
|
+
| `io.sentry.traces.profiling.sample-rate` | Float | `null` | Transaction profiling rate (legacy) |
|
|
304
|
+
| `io.sentry.traces.profiling.session-sample-rate` | Float | `null` | Continuous profiling session rate |
|
|
305
|
+
| `io.sentry.traces.profiling.lifecycle` | String | `"manual"` | `"manual"` or `"trace"` |
|
|
306
|
+
| `io.sentry.traces.profiling.start-on-app-start` | Boolean | `false` | Auto-start profiler at app launch |
|
|
307
|
+
|
|
308
|
+
Via manifest (continuous profiling):
|
|
309
|
+
|
|
310
|
+
```xml
|
|
311
|
+
<meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="0.1" />
|
|
312
|
+
<meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="trace" />
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### `ProfileLifecycle` enum
|
|
316
|
+
|
|
317
|
+
| Value | Profiler starts | Profiler stops | Requires tracing |
|
|
318
|
+
| -------- | ------------------------ | ----------------------- | ---------------- |
|
|
319
|
+
| `TRACE` | First sampled root span | All root spans finished | Yes |
|
|
320
|
+
| `MANUAL` | `Sentry.startProfiler()` | `Sentry.stopProfiler()` | No |
|
|
321
|
+
|
|
322
|
+
### Manual start/stop (MANUAL lifecycle only)
|
|
323
|
+
|
|
324
|
+
```kotlin
|
|
325
|
+
// @ApiStatus.Experimental
|
|
326
|
+
Sentry.startProfiler()
|
|
327
|
+
// ... work to profile ...
|
|
328
|
+
Sentry.stopProfiler()
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## 8. Known Limitations
|
|
334
|
+
|
|
335
|
+
### Android API minimum
|
|
336
|
+
|
|
337
|
+
Profiling uses `Debug.startMethodTracingSampling()`, which requires API 21+; effective
|
|
338
|
+
minimum is **API 22**. Silently disabled on older devices with no error or warning.
|
|
339
|
+
|
|
340
|
+
### Transaction profiling: 30-second hard cap
|
|
341
|
+
|
|
342
|
+
Profiles for transactions longer than 30 s are automatically truncated.
|
|
343
|
+
The transaction itself continues normally, but the profile has missing data for anything
|
|
344
|
+
after 30 s. Use continuous profiling to avoid this.
|
|
345
|
+
|
|
346
|
+
### 3 MB ring buffer
|
|
347
|
+
|
|
348
|
+
Transaction profiling uses a 3 MB buffer.
|
|
349
|
+
Very high-frequency call stacks on low-memory devices may overflow the buffer, causing
|
|
350
|
+
early profile termination.
|
|
351
|
+
|
|
352
|
+
### ProGuard/R8 obfuscation
|
|
353
|
+
|
|
354
|
+
Release builds with ProGuard/R8 enabled produce obfuscated frame names (e.g., `a.b()`,
|
|
355
|
+
`c.d()`). Upload mapping files to see readable names:
|
|
356
|
+
|
|
357
|
+
```kotlin
|
|
358
|
+
// build.gradle.kts
|
|
359
|
+
sentry {
|
|
360
|
+
autoUploadProguardMapping = true
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### Background transactions
|
|
365
|
+
|
|
366
|
+
If a transaction is abandoned while the app is backgrounded, the profile may be
|
|
367
|
+
truncated. `DEADLINE_EXCEEDED` transactions may not have complete profiles.
|
|
368
|
+
|
|
369
|
+
### Continuous profiling API stability
|
|
370
|
+
|
|
371
|
+
`Sentry.startProfiler()` and `Sentry.stopProfiler()` are `@ApiStatus.Experimental`. The
|
|
372
|
+
`_experiments` config block used in some SDKs is **not** used in Android — use
|
|
373
|
+
`options.profileSessionSampleRate`, `options.profileLifecycle`, and
|
|
374
|
+
`options.isProfilingStartOnAppStart` directly.
|
|
375
|
+
|
|
376
|
+
### Continuous profiling chunk duration
|
|
377
|
+
|
|
378
|
+
Chunks are emitted on a fixed 60-second cycle (`MAX_CHUNK_DURATION_MILLIS = 60_000`).
|
|
379
|
+
This is not configurable.
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## 9. Troubleshooting
|
|
384
|
+
|
|
385
|
+
| Issue | Likely cause | Solution |
|
|
386
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
387
|
+
| No profiles appearing | `profilesSampleRate` or `profileSessionSampleRate` not set, or `tracesSampleRate = 0` | Set both sample rates > 0; verify DSN is correct |
|
|
388
|
+
| Frame names appear obfuscated (`a.b`, `c.d`) | ProGuard/R8 mapping not uploaded | Configure `autoUploadProguardMapping = true` in the Sentry Gradle plugin |
|
|
389
|
+
| Transaction profiling stops at 30 s | Hard-coded 30 s cap | Switch to continuous profiling (`profileSessionSampleRate`) |
|
|
390
|
+
| Continuous profiling has no data | `TRACE` lifecycle but no transactions sampled | Verify `tracesSampleRate > 0`; check Sentry DSN and that events appear in Sentry |
|
|
391
|
+
| `startProfiler()` has no effect | `TRACE` lifecycle selected instead of `MANUAL` | Set `options.profileLifecycle = ProfileLifecycle.MANUAL` before calling `startProfiler()` |
|
|
392
|
+
| Profiling causes visible app slowdown | Sample rate too high on low-end device | Reduce `profilesSampleRate` or `profileSessionSampleRate` to ≤ 0.05 on low-end devices |
|
|
393
|
+
| `profileSessionSampleRate` ignored | `profilesSampleRate` is also set | Remove `profilesSampleRate` — the two modes are mutually exclusive |
|
|
394
|
+
| Profiles appear for some transactions only | Expected — sample rate controls the fraction | Increase rate if you want broader coverage |
|
|
395
|
+
| App start not profiled | `isProfilingStartOnAppStart = false` (default) | Set `options.isProfilingStartOnAppStart = true` with `MANUAL` lifecycle |
|
|
396
|
+
| API < 22 device not profiling | Silently disabled | Profiling requires Android API 22+; check device API level |
|
|
397
|
+
| Profile data incomplete for long sessions | 60 s chunk boundary | Normal behavior — chunks are separate envelope items; use the trace waterfall to correlate |
|