@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,209 @@
|
|
|
1
|
+
# Logging — Sentry Cocoa SDK
|
|
2
|
+
|
|
3
|
+
> Minimum SDK (experimental): `sentry-cocoa` v8.55.0+ Minimum SDK (stable):
|
|
4
|
+
> `sentry-cocoa` v9.0.0+
|
|
5
|
+
|
|
6
|
+
## Configuration
|
|
7
|
+
|
|
8
|
+
| Option | Type | Default | Description |
|
|
9
|
+
| ------------------------- | ------------------------------ | ------- | ---------------------------------------------------------- |
|
|
10
|
+
| `enableLogs` | `Bool` | `false` | Enable structured logging (v9.0.0+, stable) |
|
|
11
|
+
| `experimental.enableLogs` | `Bool` | `false` | Enable structured logging (v8.55.0–8.x, experimental) |
|
|
12
|
+
| `beforeSendLog` | `((SentryLog) -> SentryLog?)?` | `nil` | Filter or modify logs before sending; return `nil` to drop |
|
|
13
|
+
|
|
14
|
+
## Code Examples
|
|
15
|
+
|
|
16
|
+
### Enable logging
|
|
17
|
+
|
|
18
|
+
**SDK v9.0.0+ (stable, recommended):**
|
|
19
|
+
|
|
20
|
+
```swift
|
|
21
|
+
import Sentry
|
|
22
|
+
|
|
23
|
+
SentrySDK.start { options in
|
|
24
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
25
|
+
options.enableLogs = true
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**SDK v8.55.0–8.x (experimental):**
|
|
30
|
+
|
|
31
|
+
```swift
|
|
32
|
+
SentrySDK.start { options in
|
|
33
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
34
|
+
options.experimental.enableLogs = true
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### All log levels
|
|
39
|
+
|
|
40
|
+
```swift
|
|
41
|
+
import Sentry
|
|
42
|
+
|
|
43
|
+
let logger = SentrySDK.logger
|
|
44
|
+
|
|
45
|
+
// Without attributes
|
|
46
|
+
logger.trace("Starting database connection")
|
|
47
|
+
logger.debug("Cache miss for user")
|
|
48
|
+
logger.info("Profile updated successfully")
|
|
49
|
+
logger.warn("Rate limit nearly reached")
|
|
50
|
+
logger.error("Failed to process payment")
|
|
51
|
+
logger.fatal("Database connection pool exhausted")
|
|
52
|
+
|
|
53
|
+
// With structured attributes
|
|
54
|
+
logger.trace("Starting DB connection", attributes: ["database": "users"])
|
|
55
|
+
logger.debug("Cache miss for user", attributes: ["userId": 123])
|
|
56
|
+
logger.info("Profile updated", attributes: ["profileId": 345])
|
|
57
|
+
logger.warn("Rate limit reached", attributes: ["endpoint": "/api/results/"])
|
|
58
|
+
logger.error("Payment failed", attributes: ["amount": 99.99])
|
|
59
|
+
logger.fatal("Connection pool exhausted", attributes: ["activeConnections": 100])
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Supported Swift attribute value types include `String`, `Bool`, `Int`, `Double`,
|
|
63
|
+
`Float`, arrays, and sets; other values are converted to strings.
|
|
64
|
+
|
|
65
|
+
### Log levels (severity order)
|
|
66
|
+
|
|
67
|
+
| Level | Method | Typical Use |
|
|
68
|
+
| --------- | ------------------- | ----------------------------------- |
|
|
69
|
+
| 1 — Trace | `logger.trace(...)` | Very fine-grained diagnostic events |
|
|
70
|
+
| 2 — Debug | `logger.debug(...)` | Debugging information |
|
|
71
|
+
| 3 — Info | `logger.info(...)` | General informational messages |
|
|
72
|
+
| 4 — Warn | `logger.warn(...)` | Potentially harmful situations |
|
|
73
|
+
| 5 — Error | `logger.error(...)` | Error events; app may continue |
|
|
74
|
+
| 6 — Fatal | `logger.fatal(...)` | Severe errors; likely app abort |
|
|
75
|
+
|
|
76
|
+
### Swift string interpolation as structured attributes
|
|
77
|
+
|
|
78
|
+
When you use Swift string interpolation in the message, the SDK automatically extracts
|
|
79
|
+
the interpolated values as named attributes using the key pattern
|
|
80
|
+
`sentry.message.parameter.{index}`:
|
|
81
|
+
|
|
82
|
+
```swift
|
|
83
|
+
let userId = "user_123"
|
|
84
|
+
let orderCount = 5
|
|
85
|
+
|
|
86
|
+
logger.info("User \(userId) placed \(orderCount) orders")
|
|
87
|
+
|
|
88
|
+
// Sentry receives:
|
|
89
|
+
// message template: "User %s placed %d orders"
|
|
90
|
+
// sentry.message.parameter.0 = "user_123"
|
|
91
|
+
// sentry.message.parameter.1 = 5
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This preserves the ability to search and filter by the template while retaining the
|
|
95
|
+
individual values as queryable attributes.
|
|
96
|
+
|
|
97
|
+
### beforeSendLog filter hook
|
|
98
|
+
|
|
99
|
+
```swift
|
|
100
|
+
SentrySDK.start { options in
|
|
101
|
+
options.enableLogs = true
|
|
102
|
+
options.beforeSendLog = { log in
|
|
103
|
+
// Drop trace-level logs
|
|
104
|
+
if log.level == .trace { return nil }
|
|
105
|
+
|
|
106
|
+
// Drop debug logs in production
|
|
107
|
+
if log.level == .debug && options.environment == "production" { return nil }
|
|
108
|
+
|
|
109
|
+
// Enrich all logs with app version
|
|
110
|
+
if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String {
|
|
111
|
+
log.attributes["app.version"] = SentryAttribute(string: version)
|
|
112
|
+
}
|
|
113
|
+
return log
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Available on `SentryLog`:
|
|
119
|
+
|
|
120
|
+
- `log.level` — `SentryLog.Level` (`.trace`, `.debug`, `.info`, `.warn`, `.error`,
|
|
121
|
+
`.fatal`)
|
|
122
|
+
- `log.body` — `String`
|
|
123
|
+
- `log.timestamp` — `Date`
|
|
124
|
+
- `log.attributes` — `[String: SentryAttribute]`
|
|
125
|
+
|
|
126
|
+
### Automatic default attributes
|
|
127
|
+
|
|
128
|
+
The SDK automatically attaches the following to every log entry:
|
|
129
|
+
|
|
130
|
+
- `environment` and `release`
|
|
131
|
+
- SDK name and version
|
|
132
|
+
- User ID, name, email (if set via `SentrySDK.setUser(...)`)
|
|
133
|
+
- Message template and `sentry.message.parameter.*` interpolated values
|
|
134
|
+
- Integration origin marker
|
|
135
|
+
|
|
136
|
+
### Using alongside Apple os.log
|
|
137
|
+
|
|
138
|
+
`SentrySDK.logger` is a standalone Sentry telemetry system — it is **not** a bridge to
|
|
139
|
+
`os.log` / `Logger`. To write to both:
|
|
140
|
+
|
|
141
|
+
```swift
|
|
142
|
+
import OSLog
|
|
143
|
+
import Sentry
|
|
144
|
+
|
|
145
|
+
private let osLog = Logger(subsystem: "com.myapp", category: "network")
|
|
146
|
+
|
|
147
|
+
func fetchData() {
|
|
148
|
+
osLog.info("Fetching data") // → system log / Console.app
|
|
149
|
+
SentrySDK.logger.info("Fetching data", // → Sentry Logs
|
|
150
|
+
attributes: ["subsystem": "network"])
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
There is no built-in bridge to automatically forward `OSLog` entries to Sentry.
|
|
155
|
+
|
|
156
|
+
### Full initialization example with logging
|
|
157
|
+
|
|
158
|
+
```swift
|
|
159
|
+
import Sentry
|
|
160
|
+
|
|
161
|
+
SentrySDK.start { options in
|
|
162
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
163
|
+
options.environment = "production"
|
|
164
|
+
options.enableLogs = true // v9.0.0+
|
|
165
|
+
options.beforeSendLog = { log in
|
|
166
|
+
// Drop trace and debug in production
|
|
167
|
+
guard log.level != .trace && log.level != .debug else { return nil }
|
|
168
|
+
return log
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Anywhere in your app:
|
|
173
|
+
SentrySDK.logger.info("User signed in",
|
|
174
|
+
attributes: ["userId": currentUser.id, "method": "oauth"])
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Known Limitations
|
|
178
|
+
|
|
179
|
+
- Logs can be **lost in crash scenarios** if the SDK cannot flush the buffer before the
|
|
180
|
+
app terminates — this is a known limitation of the current implementation
|
|
181
|
+
- Logs are a **separate pipeline** from error events — they are not attached to
|
|
182
|
+
breadcrumbs or spans automatically
|
|
183
|
+
- Attribute values are limited to `String`, `Int`, `Double`, and `Bool` — other types
|
|
184
|
+
must be converted
|
|
185
|
+
|
|
186
|
+
## Best Practices
|
|
187
|
+
|
|
188
|
+
- Prefer `logger.error(...)` or `logger.fatal(...)` over `SentrySDK.capture(message:)`
|
|
189
|
+
for application-level log lines — structured logs are easier to search and filter in
|
|
190
|
+
Sentry
|
|
191
|
+
- Use structured attributes instead of embedding values in the message string directly;
|
|
192
|
+
attributes are indexed and queryable
|
|
193
|
+
- Use Swift string interpolation to let the SDK extract attribute values automatically
|
|
194
|
+
- Set `beforeSendLog` to drop `trace` and `debug` in production to reduce noise and
|
|
195
|
+
volume
|
|
196
|
+
- Set the user via `SentrySDK.setUser(...)` before logging to automatically correlate
|
|
197
|
+
logs with user identities
|
|
198
|
+
|
|
199
|
+
## Troubleshooting
|
|
200
|
+
|
|
201
|
+
| Issue | Solution |
|
|
202
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
203
|
+
| Logs not appearing in Sentry | Verify `options.enableLogs = true` (v9+) or `options.experimental.enableLogs = true` (v8.55+) |
|
|
204
|
+
| Logs only partially appearing | Logs may be lost during crashes; this is a known SDK limitation |
|
|
205
|
+
| `SentrySDK.logger` not found | Requires v8.55.0+; check SPM/CocoaPods version |
|
|
206
|
+
| Attributes not queryable | Prefer `String`, `Bool`, `Int`, `Double`, `Float`, arrays, or sets; convert complex objects to stable strings |
|
|
207
|
+
| `beforeSendLog` not called | Ensure you set it before `SentrySDK.start` completes and `enableLogs = true` |
|
|
208
|
+
| Too many logs overwhelming Sentry | Use `beforeSendLog` to filter by level; set minimum level for production |
|
|
209
|
+
| Logs missing user context | Call `SentrySDK.setUser(...)` before logging to attach user identity automatically |
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Metrics — Sentry Cocoa SDK
|
|
2
|
+
|
|
3
|
+
> Minimum SDK: experimental in v9.4.0+, generally available in v9.12.0+ Swift only;
|
|
4
|
+
> Objective-C metrics API is not currently available.
|
|
5
|
+
> Metrics are enabled by default in v9.12.0+.
|
|
6
|
+
|
|
7
|
+
Use metrics for aggregate counters, gauges, and distributions that should not create
|
|
8
|
+
Sentry issues. Do not duplicate automatic tracing, app hangs, MetricKit diagnostics, or
|
|
9
|
+
error events.
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
| Option | Type | Default | Description |
|
|
14
|
+
| ------------------ | ------------------------------------ | ------- | ---------------------------------------------------------- |
|
|
15
|
+
| `enableMetrics` | `Bool` | `true` | Enable or disable metrics |
|
|
16
|
+
| `beforeSendMetric` | `((SentryMetric) -> SentryMetric?)?` | `nil` | Filter or mutate metrics before send; return `nil` to drop |
|
|
17
|
+
|
|
18
|
+
For SDK 9.4.0-9.11.x, metrics used `options.experimental.enableMetrics` and
|
|
19
|
+
`options.experimental.beforeSendMetric`. Those experimental options were removed in
|
|
20
|
+
9.12.0; use the top-level options above.
|
|
21
|
+
|
|
22
|
+
## Code Examples
|
|
23
|
+
|
|
24
|
+
### Basic setup
|
|
25
|
+
|
|
26
|
+
```swift
|
|
27
|
+
import Sentry
|
|
28
|
+
|
|
29
|
+
SentrySDK.start { options in
|
|
30
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
31
|
+
options.enableMetrics = true // default in SDK 9.12+
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Counter
|
|
36
|
+
|
|
37
|
+
Counters track discrete occurrences.
|
|
38
|
+
`count` does not accept a unit.
|
|
39
|
+
|
|
40
|
+
```swift
|
|
41
|
+
SentrySDK.metrics.count(key: "button.click")
|
|
42
|
+
|
|
43
|
+
SentrySDK.metrics.count(
|
|
44
|
+
key: "link.created",
|
|
45
|
+
value: 1,
|
|
46
|
+
attributes: [
|
|
47
|
+
"source": "share_extension",
|
|
48
|
+
"is_favorite": false
|
|
49
|
+
]
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Gauge
|
|
54
|
+
|
|
55
|
+
Gauges track current state.
|
|
56
|
+
|
|
57
|
+
```swift
|
|
58
|
+
SentrySDK.metrics.gauge(
|
|
59
|
+
key: "queue.depth",
|
|
60
|
+
value: 42,
|
|
61
|
+
attributes: ["queue": "sync"]
|
|
62
|
+
)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Distribution
|
|
66
|
+
|
|
67
|
+
Distributions track measured values where percentiles are useful.
|
|
68
|
+
|
|
69
|
+
```swift
|
|
70
|
+
SentrySDK.metrics.distribution(
|
|
71
|
+
key: "qr.render.duration",
|
|
72
|
+
value: 187.5,
|
|
73
|
+
unit: .millisecond,
|
|
74
|
+
attributes: [
|
|
75
|
+
"cache_hit": true,
|
|
76
|
+
"image_size": "1024"
|
|
77
|
+
]
|
|
78
|
+
)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### beforeSendMetric
|
|
82
|
+
|
|
83
|
+
```swift
|
|
84
|
+
SentrySDK.start { options in
|
|
85
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
86
|
+
options.beforeSendMetric = { metric in
|
|
87
|
+
var metric = metric
|
|
88
|
+
|
|
89
|
+
if case let .boolean(drop)? = metric.attributes["drop_me"], drop {
|
|
90
|
+
return nil
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
metric.attributes["processed"] = .boolean(true)
|
|
94
|
+
metric.attributes["app_area"] = .string("links")
|
|
95
|
+
return metric
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Attribute Types
|
|
101
|
+
|
|
102
|
+
Metric attributes use `SentryAttributeValue` at the capture API and
|
|
103
|
+
`SentryAttributeContent` inside `beforeSendMetric`.
|
|
104
|
+
|
|
105
|
+
Supported capture values:
|
|
106
|
+
|
|
107
|
+
- Scalar: `String`, `Bool`, `Int`, `Double`, `Float`
|
|
108
|
+
- Arrays: `[String]`, `[Bool]`, `[Int]`, `[Double]`, `[Float]`
|
|
109
|
+
- Sets: `Set<String>`, `Set<Bool>`, `Set<Int>`, `Set<Double>`, `Set<Float>` (SDK 9.13+)
|
|
110
|
+
|
|
111
|
+
Use stable, low-cardinality attributes.
|
|
112
|
+
Avoid URLs, IDs, user-entered names, or unbounded strings unless they are intentionally
|
|
113
|
+
scrubbed and useful for grouping.
|
|
114
|
+
|
|
115
|
+
## Best Practices
|
|
116
|
+
|
|
117
|
+
- Use metrics for aggregate product and app-health signals, not exceptions or stack
|
|
118
|
+
traces.
|
|
119
|
+
- Keep metric names lowercase and dot-delimited, such as `link.created` or
|
|
120
|
+
`network.reachability.changed`.
|
|
121
|
+
- Prefer distributions for durations and sizes, gauges for current state, and counters
|
|
122
|
+
for occurrences.
|
|
123
|
+
- Avoid metrics that duplicate automatic spans, failed request events, app hangs,
|
|
124
|
+
watchdog terminations, or MetricKit diagnostics.
|
|
125
|
+
- Keep `enableMetrics = true` unless the app has a policy or volume reason to disable
|
|
126
|
+
metrics.
|
|
127
|
+
|
|
128
|
+
## Troubleshooting
|
|
129
|
+
|
|
130
|
+
| Issue | Solution |
|
|
131
|
+
| ----------------------------- | ---------------------------------------------------------------------------------- |
|
|
132
|
+
| `enableMetrics` compile error | Requires SDK 9.12+; on 9.4-9.11 use `experimental.enableMetrics` or upgrade |
|
|
133
|
+
| Metric not sent | Verify `SentrySDK.start` ran and `enableMetrics` is true |
|
|
134
|
+
| Count with `unit` fails | `count` has no `unit` parameter; use `gauge` or `distribution` if units are needed |
|
|
135
|
+
| Objective-C compile issue | Metrics are Swift-only |
|
|
136
|
+
| Too many unique series | Reduce high-cardinality attributes and metric names |
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Profiling — Sentry Cocoa SDK
|
|
2
|
+
|
|
3
|
+
> Minimum SDK for UI Profiling (`configureProfiling`): `sentry-cocoa` v8.49.0+ Minimum
|
|
4
|
+
> SDK for stable `configureProfiling` API: v9.0.0+ Supported platforms: iOS and macOS.
|
|
5
|
+
> Not supported on tvOS, watchOS, or visionOS. **All legacy profiling APIs
|
|
6
|
+
> (`profilesSampleRate`, `enableAppLaunchProfiling`, continuous beta) were removed in
|
|
7
|
+
> v9.0.0.**
|
|
8
|
+
|
|
9
|
+
## Configuration
|
|
10
|
+
|
|
11
|
+
| Option | Type | Default | Description |
|
|
12
|
+
| -------------------- | ----------------------------------- | --------- | ----------------------------------------------------------------- |
|
|
13
|
+
| `configureProfiling` | `((SentryProfileOptions) -> Void)?` | `nil` | Closure to configure UI Profiling (v8.49.0+) |
|
|
14
|
+
| `sessionSampleRate` | `Float` (0.0–1.0) | `0` | Fraction of user sessions to profile; evaluated once per session |
|
|
15
|
+
| `lifecycle` | `SentryProfileLifecycle` | `.manual` | `.trace` (auto) or `.manual` (explicit start/stop) |
|
|
16
|
+
| `profileAppStarts` | `Bool` | `false` | Profile from the earliest possible lifecycle stage on next launch |
|
|
17
|
+
|
|
18
|
+
## Code Examples
|
|
19
|
+
|
|
20
|
+
### Basic setup — trace lifecycle (recommended)
|
|
21
|
+
|
|
22
|
+
```swift
|
|
23
|
+
import Sentry
|
|
24
|
+
|
|
25
|
+
SentrySDK.start { options in
|
|
26
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
27
|
+
|
|
28
|
+
// Tracing must be enabled for .trace lifecycle
|
|
29
|
+
options.tracesSampleRate = 1.0
|
|
30
|
+
|
|
31
|
+
options.configureProfiling = {
|
|
32
|
+
$0.sessionSampleRate = 1.0 // 100% of sessions; lower for production
|
|
33
|
+
$0.lifecycle = .trace // profiler runs while a root span is active
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Manual lifecycle — explicit start/stop
|
|
39
|
+
|
|
40
|
+
```swift
|
|
41
|
+
import Sentry
|
|
42
|
+
|
|
43
|
+
SentrySDK.start { options in
|
|
44
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
45
|
+
options.configureProfiling = {
|
|
46
|
+
$0.sessionSampleRate = 1.0
|
|
47
|
+
$0.lifecycle = .manual // default if omitted
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Profile a specific operation
|
|
52
|
+
@IBAction func onSyncTapped() {
|
|
53
|
+
SentrySDK.startProfiler()
|
|
54
|
+
|
|
55
|
+
URLSession.shared.dataTask(with: syncRequest) { data, _, _ in
|
|
56
|
+
self.processData(data)
|
|
57
|
+
DispatchQueue.main.async {
|
|
58
|
+
self.tableView.performBatchUpdates({
|
|
59
|
+
// update cells
|
|
60
|
+
}) { _ in
|
|
61
|
+
SentrySDK.stopProfiler()
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}.resume()
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### App launch profiling (trace lifecycle)
|
|
69
|
+
|
|
70
|
+
```swift
|
|
71
|
+
SentrySDK.start { options in
|
|
72
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
73
|
+
options.tracesSampleRate = 1.0
|
|
74
|
+
options.configureProfiling = {
|
|
75
|
+
$0.sessionSampleRate = 1.0
|
|
76
|
+
$0.lifecycle = .trace
|
|
77
|
+
$0.profileAppStarts = true // profile from earliest lifecycle stage
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Launch profile attaches to a special `app.launch` transaction (shown as **“launch”** in
|
|
83
|
+
the Sentry UI). The profiler stops automatically when:
|
|
84
|
+
|
|
85
|
+
1. `SentrySDK.startWithOptions` is called, OR
|
|
86
|
+
2. TTID/TTFD is reached (if TTID/TTFD tracking is enabled)
|
|
87
|
+
|
|
88
|
+
### Manual lifecycle — app launch profiling
|
|
89
|
+
|
|
90
|
+
With `.manual` lifecycle, a launch profile starts on the **next app launch** and
|
|
91
|
+
continues until you explicitly call `SentrySDK.stopProfiler()`.
|
|
92
|
+
|
|
93
|
+
### Compound sampling example
|
|
94
|
+
|
|
95
|
+
```swift
|
|
96
|
+
SentrySDK.start { options in
|
|
97
|
+
options.dsn = "___PUBLIC_DSN___"
|
|
98
|
+
options.tracesSampleRate = 0.5 // 50% of transactions traced
|
|
99
|
+
options.configureProfiling = {
|
|
100
|
+
$0.sessionSampleRate = 0.5 // 50% of those sessions profiled
|
|
101
|
+
$0.lifecycle = .trace
|
|
102
|
+
// Result: ~25% of root span creations will produce profile data (0.5 × 0.5)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`sessionSampleRate` is evaluated **once per session**, not per span.
|
|
108
|
+
The same decision applies to all profiler start attempts for the duration of that
|
|
109
|
+
session.
|
|
110
|
+
|
|
111
|
+
## SentryProfileLifecycle Values
|
|
112
|
+
|
|
113
|
+
| Value | Behaviour |
|
|
114
|
+
| --------- | ---------------------------------------------------------------------------------------------- |
|
|
115
|
+
| `.manual` | Profiler runs only between `SentrySDK.startProfiler()` and `SentrySDK.stopProfiler()` |
|
|
116
|
+
| `.trace` | Profiler starts automatically when a new root span is created; stops when no root spans remain |
|
|
117
|
+
|
|
118
|
+
## Manual Profiler Control
|
|
119
|
+
|
|
120
|
+
```swift
|
|
121
|
+
SentrySDK.startProfiler() // begin profiling (manual lifecycle)
|
|
122
|
+
SentrySDK.stopProfiler() // end profiling and flush data to Sentry
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## dSYM Upload Requirement
|
|
126
|
+
|
|
127
|
+
Profiling data in Sentry shows symbolicated stack frames.
|
|
128
|
+
Without dSYM files, frames appear as memory addresses.
|
|
129
|
+
|
|
130
|
+
Upload dSYMs via the Sentry Wizard build phase (added automatically during wizard
|
|
131
|
+
setup):
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Verify the build phase exists in Xcode:
|
|
135
|
+
# Target → Build Phases → "Upload Debug Symbols to Sentry"
|
|
136
|
+
# or manually:
|
|
137
|
+
sentry-cli --auth-token YOUR_TOKEN debug-files upload \
|
|
138
|
+
--org YOUR_ORG \
|
|
139
|
+
--project YOUR_PROJECT \
|
|
140
|
+
path/to/dSYMs/
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
For CI/CD, set `SENTRY_AUTH_TOKEN` as an environment variable.
|
|
144
|
+
|
|
145
|
+
## API History / Migration
|
|
146
|
+
|
|
147
|
+
| API | Introduced | Removed | Notes |
|
|
148
|
+
| ----------------------------------- | ---------- | --------- | ----------------------------------------------- |
|
|
149
|
+
| `profilesSampleRate` | 8.12.0 | **9.0.0** | Transaction-based profiling |
|
|
150
|
+
| `profilesSampler` | 8.12.0 | **9.0.0** | Dynamic transaction-based profiling |
|
|
151
|
+
| `enableAppLaunchProfiling` | 8.21.0 | **9.0.0** | Launch profiling (old) |
|
|
152
|
+
| Continuous profiling beta | 8.36.0 | **9.0.0** | Standalone `startProfiler`/`stopProfiler` (old) |
|
|
153
|
+
| `configureProfiling` (UI Profiling) | **8.49.0** | — | **Current API** |
|
|
154
|
+
|
|
155
|
+
### Migrating from legacy `profilesSampleRate`
|
|
156
|
+
|
|
157
|
+
```swift
|
|
158
|
+
// BEFORE (removed in v9.0.0)
|
|
159
|
+
SentrySDK.start { options in
|
|
160
|
+
options.tracesSampleRate = 1.0
|
|
161
|
+
options.profilesSampleRate = 1.0 // Removed: no longer exists
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// AFTER (v9.0.0+)
|
|
165
|
+
SentrySDK.start { options in
|
|
166
|
+
options.tracesSampleRate = 1.0
|
|
167
|
+
options.configureProfiling = {
|
|
168
|
+
$0.sessionSampleRate = 1.0
|
|
169
|
+
$0.lifecycle = .trace // Equivalent behavior
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## MetricKit App Hang Reports
|
|
175
|
+
|
|
176
|
+
MetricKit delivers hang diagnostic payloads on iOS 15+ and macOS 12+. Starting with
|
|
177
|
+
**sentry-cocoa v9.x** (merged via PR #7185), the SDK captures the **full call-tree
|
|
178
|
+
flamegraph** from a MetricKit hang report instead of a single stack sample.
|
|
179
|
+
|
|
180
|
+
- **No configuration required** — the improvement is automatic for all apps with
|
|
181
|
+
MetricKit-compatible OS versions
|
|
182
|
+
- In the Sentry UI, MetricKit hang issues now display a flamegraph showing all samples
|
|
183
|
+
collected during the hang, improving both diagnosis and issue grouping accuracy
|
|
184
|
+
- MetricKit reports are delivered by the OS after the hang ends (typically on next
|
|
185
|
+
launch); they complement — but do not replace — real-time app hang detection
|
|
186
|
+
(automatic in SDK v9+)
|
|
187
|
+
|
|
188
|
+
| Platform | MetricKit Availability |
|
|
189
|
+
| -------- | ---------------------- |
|
|
190
|
+
| iOS | 15+ |
|
|
191
|
+
| macOS | 12+ |
|
|
192
|
+
| tvOS | No |
|
|
193
|
+
| watchOS | No |
|
|
194
|
+
| visionOS | No |
|
|
195
|
+
|
|
196
|
+
## Best Practices
|
|
197
|
+
|
|
198
|
+
- Always set `sessionSampleRate > 0` — it defaults to `0`, so no profiling data is
|
|
199
|
+
collected unless you explicitly set it
|
|
200
|
+
- Use `.trace` lifecycle in production: the profiler only runs during active
|
|
201
|
+
transactions, minimising overhead
|
|
202
|
+
- Use `.manual` lifecycle to profile targeted operations (e.g., a specific button tap, a
|
|
203
|
+
batch import)
|
|
204
|
+
- Lower `sessionSampleRate` in production (e.g., `0.1`) — profiling adds CPU overhead on
|
|
205
|
+
older devices
|
|
206
|
+
- Upload dSYMs for every build; without them, profile data shows raw addresses
|
|
207
|
+
- `profileAppStarts = true` is most valuable for identifying slow
|
|
208
|
+
`+[AppDelegate application:didFinishLaunchingWithOptions:]` work
|
|
209
|
+
- Do not combine the old `profilesSampleRate` with `configureProfiling` — the old APIs
|
|
210
|
+
are removed in v9.0.0
|
|
211
|
+
|
|
212
|
+
## Troubleshooting
|
|
213
|
+
|
|
214
|
+
| Issue | Solution |
|
|
215
|
+
| --------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
216
|
+
| No profiling data in Sentry | Verify `sessionSampleRate > 0`; it defaults to `0` |
|
|
217
|
+
| Profiles missing for `.trace` lifecycle | Verify `tracesSampleRate > 0`; profiles only appear when transactions are sent |
|
|
218
|
+
| Stack frames show memory addresses | Upload dSYMs; verify build phase runs in both Debug and Release |
|
|
219
|
+
| Profiling not starting on app launch | Use `profileAppStarts = true`; SDK must be initialised with `SentrySDK.startWithOptions` |
|
|
220
|
+
| `configureProfiling` not available | Requires v8.49.0+; check your SPM/CocoaPods version |
|
|
221
|
+
| Old `profilesSampleRate` not compiling | Removed in v9.0.0; migrate to `configureProfiling` |
|
|
222
|
+
| Manual profiler never stops | Ensure `SentrySDK.stopProfiler()` is called on all code paths, including error branches |
|
|
223
|
+
| Excessive CPU overhead | Lower `sessionSampleRate`; switch to `.trace` lifecycle; avoid `.manual` with long-running sessions |
|