@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,229 @@
|
|
|
1
|
+
# Metrics — Sentry .NET SDK
|
|
2
|
+
|
|
3
|
+
> Minimum SDK: `Sentry` ≥ 6.1.0\
|
|
4
|
+
> Roslyn Analyzer (`SENTRY1001`): `Sentry.Compiler.Extensions` (ships with `Sentry`
|
|
5
|
+
> NuGet)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Sentry Trace-connected Metrics lets you emit counters, gauges, and distributions that
|
|
12
|
+
are automatically linked to your Sentry traces.
|
|
13
|
+
Metrics are batched and flushed periodically (every 5 seconds or 100 items).
|
|
14
|
+
|
|
15
|
+
Three metric types:
|
|
16
|
+
|
|
17
|
+
| Type | Method | Purpose |
|
|
18
|
+
| ------------ | ------------------ | ----------------------------------------------------------------------------------- |
|
|
19
|
+
| Counter | `EmitCounter` | Increment a value (e.g. request count, items processed) |
|
|
20
|
+
| Gauge | `EmitGauge` | Track a current value (e.g. queue depth, active connections) |
|
|
21
|
+
| Distribution | `EmitDistribution` | Record a measured value for statistical analysis (e.g. response time, payload size) |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Enabling Metrics
|
|
26
|
+
|
|
27
|
+
Metrics are **enabled by default** — once the SDK is initialized, `SentrySdk.Metrics`
|
|
28
|
+
works with no extra configuration.
|
|
29
|
+
Set `EnableMetrics = false` to turn them off:
|
|
30
|
+
|
|
31
|
+
```csharp
|
|
32
|
+
SentrySdk.Init(options =>
|
|
33
|
+
{
|
|
34
|
+
options.Dsn = "___YOUR_DSN___";
|
|
35
|
+
// options.EnableMetrics = false; // uncomment to disable metrics
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
> **When `EnableMetrics = false`**, all `EmitCounter` / `EmitGauge` / `EmitDistribution`
|
|
40
|
+
> calls are no-ops.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Emitting Metrics
|
|
45
|
+
|
|
46
|
+
Access the metrics API via `SentrySdk.Metrics` or `hub.Metrics`:
|
|
47
|
+
|
|
48
|
+
### Counter
|
|
49
|
+
|
|
50
|
+
```csharp
|
|
51
|
+
// Simple counter — increment by 1
|
|
52
|
+
SentrySdk.Metrics.EmitCounter("orders.completed", 1);
|
|
53
|
+
|
|
54
|
+
// Counter with attributes and scope
|
|
55
|
+
SentrySdk.Metrics.EmitCounter("orders.completed", 1,
|
|
56
|
+
new Dictionary<string, object> { ["region"] = "eu-west" },
|
|
57
|
+
scope);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Gauge
|
|
61
|
+
|
|
62
|
+
```csharp
|
|
63
|
+
// Simple gauge
|
|
64
|
+
SentrySdk.Metrics.EmitGauge("queue.depth", 42);
|
|
65
|
+
|
|
66
|
+
// Gauge with unit
|
|
67
|
+
SentrySdk.Metrics.EmitGauge("cpu.usage", 0.85, MeasurementUnit.Fraction.Ratio);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Distribution
|
|
71
|
+
|
|
72
|
+
```csharp
|
|
73
|
+
// Simple distribution
|
|
74
|
+
SentrySdk.Metrics.EmitDistribution("response.time", 120.5);
|
|
75
|
+
|
|
76
|
+
// Distribution with unit and attributes
|
|
77
|
+
SentrySdk.Metrics.EmitDistribution("payload.size", 4096L,
|
|
78
|
+
MeasurementUnit.Information.Byte,
|
|
79
|
+
new Dictionary<string, object> { ["endpoint"] = "/api/orders" },
|
|
80
|
+
scope);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Supported Numeric Types
|
|
86
|
+
|
|
87
|
+
The metrics API accepts a generic `T` constrained to `struct`, but only the following
|
|
88
|
+
numeric types are supported at runtime:
|
|
89
|
+
|
|
90
|
+
| Type | C# keyword | Supported |
|
|
91
|
+
| ---------------- | ---------- | --------- |
|
|
92
|
+
| `System.Byte` | `byte` | ✅ Yes |
|
|
93
|
+
| `System.Int16` | `short` | ✅ Yes |
|
|
94
|
+
| `System.Int32` | `int` | ✅ Yes |
|
|
95
|
+
| `System.Int64` | `long` | ✅ Yes |
|
|
96
|
+
| `System.Single` | `float` | ✅ Yes |
|
|
97
|
+
| `System.Double` | `double` | ✅ Yes |
|
|
98
|
+
| `System.SByte` | `sbyte` | ❌ No |
|
|
99
|
+
| `System.UInt16` | `ushort` | ❌ No |
|
|
100
|
+
| `System.UInt32` | `uint` | ❌ No |
|
|
101
|
+
| `System.UInt64` | `ulong` | ❌ No |
|
|
102
|
+
| `System.Decimal` | `decimal` | ❌ No |
|
|
103
|
+
|
|
104
|
+
Unsupported types are dropped at runtime (a no-op that emits a `Warning`-level
|
|
105
|
+
diagnostic log message).
|
|
106
|
+
The Roslyn analyzer `SENTRY1001` catches these at compile time instead.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## `SENTRY1001` — Roslyn Diagnostic Analyzer
|
|
111
|
+
|
|
112
|
+
The SDK ships a compile-time Roslyn analyzer that reports a **warning** when a metrics
|
|
113
|
+
API is called with an unsupported numeric type.
|
|
114
|
+
|
|
115
|
+
**Diagnostic ID:** `SENTRY1001`\
|
|
116
|
+
**Category:** `Sentry`\
|
|
117
|
+
**Severity:** Warning\
|
|
118
|
+
**Message:**
|
|
119
|
+
`{type} is unsupported type for Sentry Metrics. The only supported types are byte, short, int, long, float, and double.`
|
|
120
|
+
|
|
121
|
+
**Triggers on:**
|
|
122
|
+
|
|
123
|
+
- `SentryMetricEmitter.EmitCounter<T>()` with unsupported `T`
|
|
124
|
+
- `SentryMetricEmitter.EmitGauge<T>()` with unsupported `T`
|
|
125
|
+
- `SentryMetricEmitter.EmitDistribution<T>()` with unsupported `T`
|
|
126
|
+
- `SentryMetric.TryGetValue<T>()` with unsupported `T`
|
|
127
|
+
|
|
128
|
+
```csharp
|
|
129
|
+
// ✅ No warning — supported types
|
|
130
|
+
SentrySdk.Metrics.EmitCounter("my.counter", 1); // int → OK
|
|
131
|
+
SentrySdk.Metrics.EmitCounter("my.counter", 1L); // long → OK
|
|
132
|
+
SentrySdk.Metrics.EmitCounter("my.counter", 1.5f); // float → OK
|
|
133
|
+
SentrySdk.Metrics.EmitCounter("my.counter", 1.5); // double → OK
|
|
134
|
+
|
|
135
|
+
// ⚠️ SENTRY1001 — unsupported types
|
|
136
|
+
SentrySdk.Metrics.EmitCounter("my.counter", 1m); // decimal
|
|
137
|
+
SentrySdk.Metrics.EmitCounter("my.counter", (ulong)100); // ulong
|
|
138
|
+
SentrySdk.Metrics.EmitCounter("my.counter", (uint)1); // uint
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**To suppress** (not recommended): Add `#pragma warning disable SENTRY1001` or
|
|
142
|
+
`[SuppressMessage]`. However, the metric will still be silently dropped at runtime.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## `SetBeforeSendMetric` Callback
|
|
147
|
+
|
|
148
|
+
Filter or modify metrics before they are sent to Sentry.
|
|
149
|
+
Return `null` to drop a metric.
|
|
150
|
+
|
|
151
|
+
```csharp
|
|
152
|
+
SentrySdk.Init(options =>
|
|
153
|
+
{
|
|
154
|
+
options.Dsn = "___YOUR_DSN___";
|
|
155
|
+
options.SetBeforeSendMetric(static (SentryMetric metric) =>
|
|
156
|
+
{
|
|
157
|
+
// Drop metrics with negative values
|
|
158
|
+
if (metric.TryGetValue<double>(out var value) && value < 0)
|
|
159
|
+
{
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return metric;
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Signature:** `void SetBeforeSendMetric(Func<SentryMetric, SentryMetric?> callback)`
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## `SentryMetric.TryGetValue<T>`
|
|
173
|
+
|
|
174
|
+
Extract the numeric value from a `SentryMetric` with a type check.
|
|
175
|
+
Returns `false` if the metric’s value type does not match `T`. The same supported-type
|
|
176
|
+
rules apply — using an unsupported type triggers `SENTRY1001`.
|
|
177
|
+
|
|
178
|
+
```csharp
|
|
179
|
+
options.SetBeforeSendMetric(static (SentryMetric metric) =>
|
|
180
|
+
{
|
|
181
|
+
// ✅ Supported — double
|
|
182
|
+
if (metric.TryGetValue<double>(out var doubleValue))
|
|
183
|
+
{
|
|
184
|
+
Console.WriteLine($"Metric value: {doubleValue}");
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// ✅ Supported — long
|
|
188
|
+
if (metric.TryGetValue<long>(out var longValue) && longValue > 1000)
|
|
189
|
+
{
|
|
190
|
+
return null; // drop high-value metrics
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return metric;
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## `SentryMetric` Properties
|
|
200
|
+
|
|
201
|
+
| Property | Type | Description |
|
|
202
|
+
| ----------- | ------------------ | ------------------------------------------------- |
|
|
203
|
+
| `Timestamp` | `DateTimeOffset` | When the metric was recorded |
|
|
204
|
+
| `TraceId` | `SentryId` | Trace ID linking metric to a trace |
|
|
205
|
+
| `SpanId` | `SpanId?` | Span that was active when metric was emitted |
|
|
206
|
+
| `Type` | `SentryMetricType` | `Counter`, `Gauge`, or `Distribution` |
|
|
207
|
+
| `Name` | `string` | Hierarchical name (e.g. `api.response_time`) |
|
|
208
|
+
| `Unit` | `string?` | Unit of measurement (only for Gauge/Distribution) |
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Config Options
|
|
213
|
+
|
|
214
|
+
| Option | Type | Default | Notes |
|
|
215
|
+
| --------------------- | ----------------------------------- | ------- | -------------------------------------------------------------------------- |
|
|
216
|
+
| `EnableMetrics` | `bool` | `true` | Enabled by default; set to `false` to disable the `SentrySdk.Metrics` APIs |
|
|
217
|
+
| `SetBeforeSendMetric` | `Func<SentryMetric, SentryMetric?>` | — | Filter/modify metrics before send; return `null` to drop |
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Troubleshooting
|
|
222
|
+
|
|
223
|
+
| Issue | Cause | Solution |
|
|
224
|
+
| --------------------------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
225
|
+
| Metrics not appearing in Sentry | `EnableMetrics` set to `false` | Metrics are on by default; make sure `options.EnableMetrics` is not being set to `false` |
|
|
226
|
+
| `SENTRY1001` compiler warning | Unsupported numeric type | Use `byte`, `short`, `int`, `long`, `float`, or `double` instead |
|
|
227
|
+
| Metric emitted but silently dropped | Unsupported type at runtime (no analyzer) | Ensure the `Sentry.Compiler.Extensions` analyzer is loaded; check build output for `SENTRY1001` |
|
|
228
|
+
| `SetBeforeSendMetric` drops all metrics | Callback returns `null` unconditionally | Verify your filter logic; return `metric` for metrics you want to keep |
|
|
229
|
+
| `TryGetValue<T>` returns `false` | Type mismatch between emitted type and queried type | Use the same type that was passed to `EmitCounter`/`EmitGauge`/`EmitDistribution` |
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
# Profiling — Sentry .NET SDK
|
|
2
|
+
|
|
3
|
+
> **Alpha feature** — `Sentry.Profiling` NuGet package\
|
|
4
|
+
> Minimum SDK: `Sentry.Profiling` ≥ 4.0.0 · .NET 8.0+ required\
|
|
5
|
+
> **Not supported:** .NET Framework, Android, Blazor WASM, Native AOT (except iOS/Mac
|
|
6
|
+
> Catalyst)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The Sentry .NET SDK captures CPU profiles using the .NET EventPipe sampling
|
|
13
|
+
infrastructure (via `Microsoft.Diagnostics.NETCore.Client`). Profiles attach to
|
|
14
|
+
**transactions** — they are not standalone events.
|
|
15
|
+
|
|
16
|
+
| Platform | Mechanism | Package required |
|
|
17
|
+
| -------------------- | ----------------------------------- | -------------------------------------------- |
|
|
18
|
+
| .NET 8+ on Windows | EventPipe CPU sampling | `Sentry.Profiling` |
|
|
19
|
+
| .NET 8+ on Linux | EventPipe CPU sampling | `Sentry.Profiling` ⚠️ see Linux note |
|
|
20
|
+
| .NET 8+ on macOS | EventPipe CPU sampling | `Sentry.Profiling` |
|
|
21
|
+
| iOS / Mac Catalyst | Native profiler (via Cocoa binding) | **None** (do not install `Sentry.Profiling`) |
|
|
22
|
+
| .NET Framework | ❌ Not supported | — |
|
|
23
|
+
| Android | ❌ Not supported | — |
|
|
24
|
+
| Blazor WebAssembly | ❌ Not supported | — |
|
|
25
|
+
| Native AOT (non-iOS) | ❌ Not supported | — |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## How Profiling Attaches to Traces
|
|
30
|
+
|
|
31
|
+
Profiles are always tied to a transaction — you must have tracing enabled first:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
TracesSampleRate × ProfilesSampleRate = net profiling rate
|
|
35
|
+
|
|
36
|
+
Example:
|
|
37
|
+
TracesSampleRate = 0.5 → 50% of requests create transactions
|
|
38
|
+
ProfilesSampleRate = 0.4 → 40% of those transactions get profiled
|
|
39
|
+
Net profiling rate = 20% of all requests
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
When a transaction starts:
|
|
43
|
+
|
|
44
|
+
1. `ProfilingIntegration` checks whether this transaction should be profiled (per
|
|
45
|
+
`ProfilesSampleRate`)
|
|
46
|
+
2. If yes, an EventPipe session starts collecting CPU samples
|
|
47
|
+
3. When `transaction.Finish()` is called, the profiler stops and attaches the profile
|
|
48
|
+
data to the transaction envelope
|
|
49
|
+
4. Both the transaction and the profile are sent to Sentry together — you can drill from
|
|
50
|
+
a slow span directly into a flame graph
|
|
51
|
+
|
|
52
|
+
> **One profiler at a time:** Only one profile can be active per process.
|
|
53
|
+
> Nested transactions will not each receive their own profile.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
dotnet add package Sentry.Profiling
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
> **Do NOT install `Sentry.Profiling` for iOS or Mac Catalyst.** Those platforms use the
|
|
64
|
+
> bundled native profiler (via the Cocoa binding) — installing this package on those
|
|
65
|
+
> targets has no effect.
|
|
66
|
+
>
|
|
67
|
+
> **Do NOT install `Sentry.Profiling` for Android or Blazor WebAssembly** either —
|
|
68
|
+
> profiling is not supported on those platforms, so the package has no effect.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Basic Setup
|
|
73
|
+
|
|
74
|
+
Profiling requires three additions to your `SentrySdk.Init` call:
|
|
75
|
+
|
|
76
|
+
```csharp
|
|
77
|
+
SentrySdk.Init(options =>
|
|
78
|
+
{
|
|
79
|
+
options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
|
|
80
|
+
|
|
81
|
+
// Step 1: Enable tracing (REQUIRED — profiling won't work without it)
|
|
82
|
+
options.TracesSampleRate = 1.0;
|
|
83
|
+
|
|
84
|
+
// Step 2: Set what fraction of sampled transactions get profiled
|
|
85
|
+
options.ProfilesSampleRate = 1.0; // 1.0 = 100% for development; lower in production
|
|
86
|
+
|
|
87
|
+
// Step 3: Register the profiling integration
|
|
88
|
+
options.AddProfilingIntegration();
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### ASP.NET Core
|
|
93
|
+
|
|
94
|
+
```csharp
|
|
95
|
+
// Program.cs
|
|
96
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
97
|
+
|
|
98
|
+
builder.WebHost.UseSentry(options =>
|
|
99
|
+
{
|
|
100
|
+
options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
|
|
101
|
+
options.TracesSampleRate = 1.0;
|
|
102
|
+
options.ProfilesSampleRate = 0.1; // Profile 10% of sampled transactions in production
|
|
103
|
+
options.AddProfilingIntegration();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
var app = builder.Build();
|
|
107
|
+
app.MapControllers();
|
|
108
|
+
app.Run();
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Synchronous Startup (Recommended for Most Apps)
|
|
114
|
+
|
|
115
|
+
`AddProfilingIntegration()` initializes the EventPipe session asynchronously on a
|
|
116
|
+
background thread. Transactions that start immediately after `SentrySdk.Init()` may not
|
|
117
|
+
get a profile because the profiler isn’t ready yet.
|
|
118
|
+
|
|
119
|
+
```csharp
|
|
120
|
+
// ❌ Problem: profiler may not be ready when first transaction starts
|
|
121
|
+
SentrySdk.Init(options => {
|
|
122
|
+
options.AddProfilingIntegration(); // async startup
|
|
123
|
+
});
|
|
124
|
+
var tx = SentrySdk.StartTransaction("startup", "init"); // profiler might miss this
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```csharp
|
|
128
|
+
// ✅ Fix: provide a timeout to block until profiler is ready
|
|
129
|
+
SentrySdk.Init(options => {
|
|
130
|
+
options.AddProfilingIntegration(TimeSpan.FromMilliseconds(500));
|
|
131
|
+
});
|
|
132
|
+
var tx = SentrySdk.StartTransaction("startup", "init"); // profiler guaranteed ready
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
> **iOS/Mac Catalyst note:** The native profiler always starts synchronously.
|
|
136
|
+
> The `TimeSpan` parameter is accepted but has no effect on those platforms.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Configuration Options
|
|
141
|
+
|
|
142
|
+
| Option | Type | Default | Description |
|
|
143
|
+
| ----------------------------------- | ------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
144
|
+
| `TracesSampleRate` | `double?` | `null` | **Required.** Fraction of requests that create transactions (0.0–1.0). Profiling does nothing without this. |
|
|
145
|
+
| `TracesSampler` | `Func<TransactionSamplingContext, double?>` | `null` | Alternative to `TracesSampleRate` for dynamic per-request sampling. Takes precedence when set. |
|
|
146
|
+
| `ProfilesSampleRate` | `double?` | `null` | Fraction of sampled transactions that get profiled (0.0–1.0). Null = profiling disabled. |
|
|
147
|
+
| `AddProfilingIntegration()` | — | — | Registers `SamplingTransactionProfilerFactory`. **Required.** |
|
|
148
|
+
| `AddProfilingIntegration(TimeSpan)` | `TimeSpan` | — | Same as above, but blocks synchronously until the EventPipe session starts (or timeout). Recommended for most apps. |
|
|
149
|
+
|
|
150
|
+
### Recommended Production Settings
|
|
151
|
+
|
|
152
|
+
```csharp
|
|
153
|
+
SentrySdk.Init(options =>
|
|
154
|
+
{
|
|
155
|
+
options.Dsn = "...";
|
|
156
|
+
|
|
157
|
+
// Sample 20% of transactions
|
|
158
|
+
options.TracesSampleRate = 0.2;
|
|
159
|
+
|
|
160
|
+
// Profile 50% of those — net 10% of all requests get profiled
|
|
161
|
+
options.ProfilesSampleRate = 0.5;
|
|
162
|
+
|
|
163
|
+
// Block up to 500ms so early-startup transactions are captured
|
|
164
|
+
options.AddProfilingIntegration(TimeSpan.FromMilliseconds(500));
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Platform-Specific Notes
|
|
171
|
+
|
|
172
|
+
### Linux
|
|
173
|
+
|
|
174
|
+
Supported on .NET 8+. Because profiling is in Alpha and depends on the EventPipe tracing
|
|
175
|
+
stack, initialization can fail in some minimal/trimmed Linux container images.
|
|
176
|
+
If you deploy to containers, guard `AddProfilingIntegration()` so a profiler-init
|
|
177
|
+
failure can’t take down startup, and test on your specific image before enabling in
|
|
178
|
+
production:
|
|
179
|
+
|
|
180
|
+
```csharp
|
|
181
|
+
try
|
|
182
|
+
{
|
|
183
|
+
options.AddProfilingIntegration();
|
|
184
|
+
}
|
|
185
|
+
catch (Exception ex)
|
|
186
|
+
{
|
|
187
|
+
Console.Error.WriteLine($"[Sentry] Profiling unavailable on this platform: {ex.Message}");
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### iOS / Mac Catalyst
|
|
192
|
+
|
|
193
|
+
On iOS/Mac Catalyst, profiling is provided by the bundled native profiler (via the Cocoa
|
|
194
|
+
binding) — do **not** install `Sentry.Profiling`.
|
|
195
|
+
|
|
196
|
+
```csharp
|
|
197
|
+
// iOS: same configuration, but do NOT install Sentry.Profiling
|
|
198
|
+
SentrySdk.Init(options =>
|
|
199
|
+
{
|
|
200
|
+
options.Dsn = "...";
|
|
201
|
+
options.TracesSampleRate = 1.0;
|
|
202
|
+
options.ProfilesSampleRate = 1.0;
|
|
203
|
+
options.AddProfilingIntegration(); // delegates to native profiler on iOS/Mac Catalyst
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Windows
|
|
208
|
+
|
|
209
|
+
Fully supported on .NET 8+. No extra steps required.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Limitations and Known Issues
|
|
214
|
+
|
|
215
|
+
| Limitation | Details |
|
|
216
|
+
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
217
|
+
| **Alpha status** | The profiling feature is officially in Alpha. APIs may change and it is not recommended for mission-critical production use without testing. |
|
|
218
|
+
| **One profile at a time** | Only one transaction profiler can be active per process. If two transactions run concurrently, only the first one gets a profile. |
|
|
219
|
+
| **30-second cap** | Profiles are hard-capped at 30 seconds. Transactions longer than 30 seconds have their profile truncated. |
|
|
220
|
+
| **.NET 8+ only** | The `Sentry.Profiling` package targets .NET 8/9/10. .NET 6/7 and .NET Framework are not supported. |
|
|
221
|
+
| **Container init failures** | On minimal/trimmed Linux container images, profiler initialization can fail. Guard `AddProfilingIntegration()` in a try/catch and test on your image. |
|
|
222
|
+
| **OTel conflict** | When using `UseOpenTelemetry()` + `AddProfilingIntegration()`, profiles may not surface all application frames. Verify on your SDK version; try disabling one integration to isolate. |
|
|
223
|
+
| **“Unknown frames”** | Some stack frames appear as “unknown” in the Sentry UI. This is expected — they are anonymous JIT helper methods in System assemblies that can’t be resolved to named methods. |
|
|
224
|
+
| **No Android / WASM** | Android and Blazor WebAssembly are not supported. |
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Complete Setup Example
|
|
229
|
+
|
|
230
|
+
```csharp
|
|
231
|
+
// Program.cs — ASP.NET Core with tracing + profiling
|
|
232
|
+
|
|
233
|
+
using Sentry;
|
|
234
|
+
|
|
235
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
236
|
+
|
|
237
|
+
builder.WebHost.UseSentry(options =>
|
|
238
|
+
{
|
|
239
|
+
options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
|
|
240
|
+
options.Environment = builder.Environment.EnvironmentName;
|
|
241
|
+
options.Release = "my-app@1.2.3";
|
|
242
|
+
|
|
243
|
+
// Tracing: sample 10% of requests in production
|
|
244
|
+
options.TracesSampleRate = builder.Environment.IsProduction() ? 0.1 : 1.0;
|
|
245
|
+
|
|
246
|
+
// Profiling: profile 50% of sampled transactions
|
|
247
|
+
// Net result: 5% of all production requests are profiled
|
|
248
|
+
options.ProfilesSampleRate = 0.5;
|
|
249
|
+
|
|
250
|
+
// Block up to 500ms so early-startup transactions aren't missed
|
|
251
|
+
options.AddProfilingIntegration(TimeSpan.FromMilliseconds(500));
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
var app = builder.Build();
|
|
255
|
+
app.MapControllers();
|
|
256
|
+
app.Run();
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Console / Worker Service
|
|
260
|
+
|
|
261
|
+
```csharp
|
|
262
|
+
using Sentry;
|
|
263
|
+
|
|
264
|
+
SentrySdk.Init(options =>
|
|
265
|
+
{
|
|
266
|
+
options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
|
|
267
|
+
options.TracesSampleRate = 1.0;
|
|
268
|
+
options.ProfilesSampleRate = 1.0;
|
|
269
|
+
options.AddProfilingIntegration(TimeSpan.FromMilliseconds(500));
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// The profiler is ready — this transaction will be profiled
|
|
273
|
+
var transaction = SentrySdk.StartTransaction("data-import", "task");
|
|
274
|
+
SentrySdk.ConfigureScope(s => s.Transaction = transaction);
|
|
275
|
+
|
|
276
|
+
// ... your work here ...
|
|
277
|
+
|
|
278
|
+
transaction.Finish(SpanStatus.Ok);
|
|
279
|
+
// Profile is bundled with the transaction and sent to Sentry
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Troubleshooting
|
|
285
|
+
|
|
286
|
+
| Issue | Solution |
|
|
287
|
+
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
288
|
+
| No profiles appearing in Sentry | Verify `ProfilesSampleRate > 0` AND `TracesSampleRate > 0`. Both must be set. Check that `AddProfilingIntegration()` is called. |
|
|
289
|
+
| Early-startup transactions not profiled | Use `AddProfilingIntegration(TimeSpan.FromMilliseconds(500))` to block until the EventPipe session is ready before the first transaction starts. |
|
|
290
|
+
| Profiler init throws on startup (Linux containers) | Wrap `AddProfilingIntegration()` in try/catch and test on your specific container image. Consider disabling profiling there until confirmed working. |
|
|
291
|
+
| Profiles missing application frames when using OTel | Profiling with `UseOpenTelemetry()` may not surface all frames. Verify on your SDK version; try disabling one integration to isolate. |
|
|
292
|
+
| Concurrent transactions — second one not profiled | Expected behavior. Only one profiler runs at a time. The first concurrent transaction wins the profiler slot. |
|
|
293
|
+
| Profile truncated after 30 seconds | Hard cap in the SDK. Split long-running operations into multiple shorter transactions if full profiling coverage is needed. |
|
|
294
|
+
| `.NET 6` or `.NET 7` — profiling not working | Not supported. EventPipe profiling requires .NET 8+. |
|
|
295
|
+
| “Unknown frames” in flame graph | Expected for JIT internals. Focus on named application frames. |
|
|
296
|
+
| iOS profiles not appearing (using `Sentry.Profiling` package) | Remove `Sentry.Profiling` from iOS targets. iOS/Mac Catalyst use the bundled native profiler (via the Cocoa binding) — the NuGet package is not needed and may conflict. |
|