@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,897 @@
|
|
|
1
|
+
# Tracing — Sentry .NET SDK
|
|
2
|
+
|
|
3
|
+
> Minimum SDK: `Sentry` ≥4.0.0\
|
|
4
|
+
> OpenTelemetry bridge: `Sentry.OpenTelemetry` ≥3.34.0 · OTLP export:
|
|
5
|
+
> `Sentry.OpenTelemetry.Exporter` ≥6.5.0\
|
|
6
|
+
> Custom measurements: `Sentry` ≥3.23.0\
|
|
7
|
+
> Profiling (Alpha): `Sentry.Profiling` ≥4.0.0, .NET 8+ only
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## How Tracing Is Activated
|
|
12
|
+
|
|
13
|
+
Tracing is **disabled by default**. Enable it by setting `TracesSampleRate` or
|
|
14
|
+
`TracesSampler` during `SentrySdk.Init()`:
|
|
15
|
+
|
|
16
|
+
```csharp
|
|
17
|
+
SentrySdk.Init(options =>
|
|
18
|
+
{
|
|
19
|
+
options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
|
|
20
|
+
options.TracesSampleRate = 1.0; // capture all transactions (lower in production)
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
> **Without one of these set**, no spans or transactions are created regardless of other
|
|
25
|
+
> configuration.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## `TracesSampleRate` — Uniform Sampling
|
|
30
|
+
|
|
31
|
+
A `double?` between `0.0` (capture nothing) and `1.0` (capture everything).
|
|
32
|
+
Defaults to `null` (disabled).
|
|
33
|
+
|
|
34
|
+
```csharp
|
|
35
|
+
options.TracesSampleRate = 0.2; // sample 20% of transactions
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## `TracesSampler` — Dynamic Per-Transaction Sampling
|
|
41
|
+
|
|
42
|
+
When set, takes **precedence** over `TracesSampleRate`. Receives a
|
|
43
|
+
`TransactionSamplingContext` and returns `double?` (0.0–1.0) or `null` (falls back to
|
|
44
|
+
`TracesSampleRate`).
|
|
45
|
+
|
|
46
|
+
```csharp
|
|
47
|
+
options.TracesSampler = context =>
|
|
48
|
+
{
|
|
49
|
+
var name = context.TransactionContext.Name;
|
|
50
|
+
var op = context.TransactionContext.Operation;
|
|
51
|
+
|
|
52
|
+
// Drop health checks entirely
|
|
53
|
+
if (name.Contains("/health") || name.Contains("/ping"))
|
|
54
|
+
return 0.0;
|
|
55
|
+
|
|
56
|
+
// Always capture checkout flow
|
|
57
|
+
if (name == "checkout" || op == "perform-checkout")
|
|
58
|
+
return 1.0;
|
|
59
|
+
|
|
60
|
+
// Read caller-supplied hint
|
|
61
|
+
if (context.CustomSamplingContext.TryGetValue("isCritical", out var flag) && flag is true)
|
|
62
|
+
return 1.0;
|
|
63
|
+
|
|
64
|
+
return 0.1; // default: 10%
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Passing Custom Sampling Context
|
|
69
|
+
|
|
70
|
+
```csharp
|
|
71
|
+
var transaction = SentrySdk.StartTransaction(
|
|
72
|
+
new TransactionContext("checkout", "http.server"),
|
|
73
|
+
new Dictionary<string, object?> { ["isCritical"] = true }
|
|
74
|
+
);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`TransactionSamplingContext` shape:
|
|
78
|
+
|
|
79
|
+
```csharp
|
|
80
|
+
public class TransactionSamplingContext
|
|
81
|
+
{
|
|
82
|
+
public ITransactionContext TransactionContext { get; }
|
|
83
|
+
public IReadOnlyDictionary<string, object?> CustomSamplingContext { get; }
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## ASP.NET Core Middleware Integration
|
|
90
|
+
|
|
91
|
+
### Setup
|
|
92
|
+
|
|
93
|
+
```csharp
|
|
94
|
+
// Program.cs — .NET 6+ minimal API
|
|
95
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
96
|
+
|
|
97
|
+
builder.WebHost.UseSentry(options =>
|
|
98
|
+
{
|
|
99
|
+
options.Dsn = "https://...@o0.ingest.sentry.io/...";
|
|
100
|
+
options.TracesSampleRate = 1.0;
|
|
101
|
+
options.SendDefaultPii = true; // include user info in transactions
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
var app = builder.Build();
|
|
105
|
+
|
|
106
|
+
app.UseRouting();
|
|
107
|
+
app.UseAuthentication();
|
|
108
|
+
app.UseAuthorization();
|
|
109
|
+
app.MapControllers();
|
|
110
|
+
|
|
111
|
+
app.Run();
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### What Happens Automatically
|
|
115
|
+
|
|
116
|
+
| Behavior | Detail |
|
|
117
|
+
| ------------------------------ | --------------------------------------------------------------------------------------------------------- |
|
|
118
|
+
| One transaction per request | `SentryTracingMiddleware` creates an `ITransactionTracer` for every HTTP request |
|
|
119
|
+
| Route-based naming | Transaction name = route template (e.g., `GET /api/users/{id}`) with `TransactionNameSource.Route` |
|
|
120
|
+
| Error linking | Transaction is set on scope → all errors captured during the request are linked to it |
|
|
121
|
+
| Distributed trace continuation | Incoming `sentry-trace` + `baggage` headers are read; `ContinueTrace()` is called automatically |
|
|
122
|
+
| Outgoing HTTP spans | `SentryHttpMessageHandler` auto-registered with `IHttpClientFactory` → child spans on every outbound call |
|
|
123
|
+
| EF Core / SQLClient spans | `DiagnosticSource` integration adds `db.*` child spans automatically (≥3.9.0) |
|
|
124
|
+
| Transaction send | Finished and sent to Sentry when the response is written |
|
|
125
|
+
|
|
126
|
+
### Dropping or Renaming Transactions
|
|
127
|
+
|
|
128
|
+
```csharp
|
|
129
|
+
options.SetBeforeSendTransaction(transaction =>
|
|
130
|
+
{
|
|
131
|
+
// Drop internal/health routes
|
|
132
|
+
if (transaction.Name.StartsWith("GET /internal/")) return null;
|
|
133
|
+
|
|
134
|
+
return transaction;
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Auto-Instrumentation Reference
|
|
141
|
+
|
|
142
|
+
| Integration | Spans Created | Package | Notes |
|
|
143
|
+
| ------------------------------------ | ----------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------- |
|
|
144
|
+
| ASP.NET Core requests | `http.server` transaction per request | `Sentry.AspNetCore` | Enabled automatically by `UseSentry()` |
|
|
145
|
+
| Outgoing HTTP (`IHttpClientFactory`) | `http.client` spans | `Sentry.AspNetCore` | Requires active transaction on scope |
|
|
146
|
+
| EF Core queries | `db.query.compile`, `db.connection`, `db.query` | `Sentry.DiagnosticSource` (auto in `Sentry.AspNetCore` ≥3.9.0) | Opt out with `DisableDiagnosticSourceIntegration()` |
|
|
147
|
+
| SQLClient | `db.connection`, `db.query` | `Sentry.DiagnosticSource` | Same as EF Core |
|
|
148
|
+
| Azure Functions Worker | Transaction per invocation | `Sentry.AzureFunctions.Worker` | Auto-registered |
|
|
149
|
+
| Hangfire jobs | Transaction per job | `Sentry.Hangfire` | Auto-registered |
|
|
150
|
+
| `Microsoft.Extensions.AI` | `ai.*` spans | `Sentry.Extensions.AI` | — |
|
|
151
|
+
|
|
152
|
+
### EF Core Span Types
|
|
153
|
+
|
|
154
|
+
Three spans are created automatically per EF Core query:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
db.query.compile — query compilation / optimization (cached after first run)
|
|
158
|
+
db.connection — database connection lifecycle
|
|
159
|
+
db.query — actual SQL execution
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Outgoing HTTP Auto-Instrumentation
|
|
163
|
+
|
|
164
|
+
Spans are only created when there is an **active transaction on scope**. For manual
|
|
165
|
+
`HttpClient` construction outside of `IHttpClientFactory`:
|
|
166
|
+
|
|
167
|
+
```csharp
|
|
168
|
+
var sentryHandler = new SentryHttpMessageHandler();
|
|
169
|
+
var httpClient = new HttpClient(sentryHandler);
|
|
170
|
+
|
|
171
|
+
// Must have a transaction active first
|
|
172
|
+
var tx = SentrySdk.StartTransaction("my-op", "http.client");
|
|
173
|
+
SentrySdk.ConfigureScope(s => s.Transaction = tx);
|
|
174
|
+
|
|
175
|
+
var response = await httpClient.GetStringAsync("https://api.example.com");
|
|
176
|
+
// ^ creates a "GET https://api.example.com" child span
|
|
177
|
+
|
|
178
|
+
tx.Finish();
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Custom Instrumentation
|
|
184
|
+
|
|
185
|
+
### Minimal Example
|
|
186
|
+
|
|
187
|
+
```csharp
|
|
188
|
+
var transaction = SentrySdk.StartTransaction("test-transaction", "test-operation");
|
|
189
|
+
|
|
190
|
+
var span = transaction.StartChild("test-child-operation");
|
|
191
|
+
// ... do work ...
|
|
192
|
+
span.Finish();
|
|
193
|
+
|
|
194
|
+
transaction.Finish(); // sends everything to Sentry
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Real-World Example: Checkout Flow
|
|
198
|
+
|
|
199
|
+
```csharp
|
|
200
|
+
public async Task PerformCheckoutAsync()
|
|
201
|
+
{
|
|
202
|
+
var transaction = SentrySdk.StartTransaction("checkout", "perform-checkout");
|
|
203
|
+
|
|
204
|
+
// Set on scope so that:
|
|
205
|
+
// 1. Errors during this transaction are linked to it
|
|
206
|
+
// 2. Auto-instrumentation (HTTP, EF Core) attaches child spans to it
|
|
207
|
+
SentrySdk.ConfigureScope(scope => scope.Transaction = transaction);
|
|
208
|
+
|
|
209
|
+
// Validate cart
|
|
210
|
+
var validationSpan = transaction.StartChild("validation", "validating shopping cart");
|
|
211
|
+
try
|
|
212
|
+
{
|
|
213
|
+
await ValidateShoppingCartAsync();
|
|
214
|
+
validationSpan.Finish(SpanStatus.Ok);
|
|
215
|
+
}
|
|
216
|
+
catch (Exception ex)
|
|
217
|
+
{
|
|
218
|
+
validationSpan.Finish(ex); // auto-maps exception type → SpanStatus
|
|
219
|
+
transaction.Finish(ex);
|
|
220
|
+
throw;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Process payment
|
|
224
|
+
var paymentSpan = transaction.StartChild("payment", "processing payment");
|
|
225
|
+
await ProcessPaymentAsync();
|
|
226
|
+
paymentSpan.Finish(SpanStatus.Ok);
|
|
227
|
+
|
|
228
|
+
// Send confirmation
|
|
229
|
+
var emailSpan = transaction.StartChild("email", "sending confirmation email");
|
|
230
|
+
await SendConfirmationEmailAsync();
|
|
231
|
+
emailSpan.Finish(SpanStatus.Ok);
|
|
232
|
+
|
|
233
|
+
transaction.Finish(SpanStatus.Ok);
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Attaching to an Active Transaction
|
|
238
|
+
|
|
239
|
+
```csharp
|
|
240
|
+
public async Task DoSomethingAsync()
|
|
241
|
+
{
|
|
242
|
+
var activeSpan = SentrySdk.GetSpan();
|
|
243
|
+
|
|
244
|
+
if (activeSpan == null)
|
|
245
|
+
{
|
|
246
|
+
// No transaction in scope — start a new root transaction
|
|
247
|
+
activeSpan = SentrySdk.StartTransaction("task", "background-job");
|
|
248
|
+
}
|
|
249
|
+
else
|
|
250
|
+
{
|
|
251
|
+
// Transaction already running — add a child
|
|
252
|
+
activeSpan = activeSpan.StartChild("subtask");
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// ... work ...
|
|
256
|
+
activeSpan.Finish();
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Nested Spans with Data
|
|
261
|
+
|
|
262
|
+
```csharp
|
|
263
|
+
var transaction = SentrySdk.StartTransaction("data-pipeline", "pipeline");
|
|
264
|
+
|
|
265
|
+
var fetchSpan = transaction.StartChild("http.client", "fetch raw data");
|
|
266
|
+
var parseSpan = fetchSpan.StartChild("serialize", "parse JSON response");
|
|
267
|
+
parseSpan.Finish();
|
|
268
|
+
fetchSpan.Finish();
|
|
269
|
+
|
|
270
|
+
var processSpan = transaction.StartChild("function", "transform data");
|
|
271
|
+
var dbSpan = processSpan.StartChild("db.query", "INSERT INTO results");
|
|
272
|
+
dbSpan.SetData("db.system", "postgresql");
|
|
273
|
+
dbSpan.SetData("db.statement", "INSERT INTO results (data) VALUES (?)");
|
|
274
|
+
dbSpan.Finish();
|
|
275
|
+
processSpan.Finish();
|
|
276
|
+
|
|
277
|
+
transaction.Finish();
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### DI-Friendly Pattern (`IHub`)
|
|
281
|
+
|
|
282
|
+
In ASP.NET Core, inject `IHub` instead of using the static `SentrySdk` API:
|
|
283
|
+
|
|
284
|
+
```csharp
|
|
285
|
+
public class OrderService
|
|
286
|
+
{
|
|
287
|
+
private readonly IHub _hub;
|
|
288
|
+
public OrderService(IHub hub) => _hub = hub;
|
|
289
|
+
|
|
290
|
+
public async Task ProcessOrderAsync(int orderId)
|
|
291
|
+
{
|
|
292
|
+
var transaction = _hub.StartTransaction("process-order", "task");
|
|
293
|
+
SentrySdk.ConfigureScope(s => s.Transaction = transaction);
|
|
294
|
+
|
|
295
|
+
var span = transaction.StartChild("db.query", $"SELECT * FROM orders WHERE id = {orderId}");
|
|
296
|
+
try
|
|
297
|
+
{
|
|
298
|
+
await FetchOrderAsync(orderId);
|
|
299
|
+
span.Finish(SpanStatus.Ok);
|
|
300
|
+
transaction.Finish(SpanStatus.Ok);
|
|
301
|
+
}
|
|
302
|
+
catch (Exception ex)
|
|
303
|
+
{
|
|
304
|
+
span.Finish(ex);
|
|
305
|
+
transaction.Finish(ex);
|
|
306
|
+
throw;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Distributed Tracing
|
|
315
|
+
|
|
316
|
+
### Propagation Headers
|
|
317
|
+
|
|
318
|
+
Sentry uses two HTTP headers to propagate trace context between services:
|
|
319
|
+
|
|
320
|
+
| Header | Format | Purpose |
|
|
321
|
+
| -------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
322
|
+
| `sentry-trace` | `traceId-spanId-samplingDecision` | Links spans across services into one trace |
|
|
323
|
+
| `baggage` | W3C Baggage | Carries Dynamic Sampling Context (DSC): `sentry-trace_id`, `sentry-public_key`, `sentry-environment`, `sentry-release`, `sentry-transaction`, etc. |
|
|
324
|
+
|
|
325
|
+
> **CORS note:** If you have browser frontends, explicitly allowlist `sentry-trace` and
|
|
326
|
+
> `baggage` in your CORS policy — they’re blocked by default as non-simple headers.
|
|
327
|
+
|
|
328
|
+
### Automatic Propagation (ASP.NET Core)
|
|
329
|
+
|
|
330
|
+
No configuration needed:
|
|
331
|
+
|
|
332
|
+
- **Incoming:** `SentryTracingMiddleware` reads `sentry-trace` + `baggage` and calls
|
|
333
|
+
`ContinueTrace()` automatically
|
|
334
|
+
- **Outgoing:** `SentryHttpMessageHandler` injects `sentry-trace` + `baggage` into all
|
|
335
|
+
`IHttpClientFactory` requests
|
|
336
|
+
|
|
337
|
+
### Restrict Which Hosts Receive Trace Headers
|
|
338
|
+
|
|
339
|
+
By default, headers are injected into **all** outgoing requests.
|
|
340
|
+
Restrict with:
|
|
341
|
+
|
|
342
|
+
```csharp
|
|
343
|
+
options.TracePropagationTargets = new List<StringOrRegex>
|
|
344
|
+
{
|
|
345
|
+
"api.mycompany.com",
|
|
346
|
+
new StringOrRegex(new Regex(@"^https://.*\.mycompany\.com")),
|
|
347
|
+
};
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Manual Propagation — Outgoing
|
|
351
|
+
|
|
352
|
+
```csharp
|
|
353
|
+
// Read from active transaction
|
|
354
|
+
var sentryTrace = SentrySdk.GetTraceHeader()?.ToString();
|
|
355
|
+
var baggage = SentrySdk.GetBaggage()?.ToString();
|
|
356
|
+
|
|
357
|
+
// W3C traceparent (alternative format)
|
|
358
|
+
var traceparent = SentrySdk.GetTraceparentHeader()?.ToString();
|
|
359
|
+
|
|
360
|
+
// Inject into your request
|
|
361
|
+
request.Headers["sentry-trace"] = sentryTrace;
|
|
362
|
+
request.Headers["baggage"] = baggage;
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Manual Propagation — Incoming (`ContinueTrace`)
|
|
366
|
+
|
|
367
|
+
```csharp
|
|
368
|
+
// Service B receives an HTTP request from Service A
|
|
369
|
+
var sentryTraceHeader = httpRequest.Headers["sentry-trace"];
|
|
370
|
+
var baggageHeader = httpRequest.Headers["baggage"];
|
|
371
|
+
|
|
372
|
+
// ContinueTrace parses headers and returns a pre-populated TransactionContext
|
|
373
|
+
// with the upstream traceId, parentSpanId, and sampling decision
|
|
374
|
+
var ctx = SentrySdk.ContinueTrace(
|
|
375
|
+
sentryTraceHeader,
|
|
376
|
+
baggageHeader,
|
|
377
|
+
name: "process-incoming-request",
|
|
378
|
+
operation: "http.server"
|
|
379
|
+
);
|
|
380
|
+
|
|
381
|
+
var transaction = SentrySdk.StartTransaction(ctx);
|
|
382
|
+
// Now this transaction is part of the same distributed trace as Service A
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Producer / Consumer Queue Example
|
|
386
|
+
|
|
387
|
+
**Producer:**
|
|
388
|
+
|
|
389
|
+
```csharp
|
|
390
|
+
var transaction = SentrySdk.StartTransaction("order-submitted", "function");
|
|
391
|
+
|
|
392
|
+
var publishSpan = transaction.StartChild("queue.publish", "orders");
|
|
393
|
+
publishSpan.SetData("messaging.message.id", messageId);
|
|
394
|
+
publishSpan.SetData("messaging.destination.name", "orders-queue");
|
|
395
|
+
publishSpan.SetData("messaging.message.body.size", Encoding.UTF8.GetByteCount(payload));
|
|
396
|
+
|
|
397
|
+
// Embed trace context in the message envelope
|
|
398
|
+
var envelope = new MessageEnvelope
|
|
399
|
+
{
|
|
400
|
+
Payload = payload,
|
|
401
|
+
SentryTrace = SentrySdk.GetTraceHeader()?.ToString(),
|
|
402
|
+
Baggage = SentrySdk.GetBaggage()?.ToString(),
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
await queue.PublishAsync("orders-queue", envelope);
|
|
406
|
+
publishSpan.Finish();
|
|
407
|
+
transaction.Finish();
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**Consumer:**
|
|
411
|
+
|
|
412
|
+
```csharp
|
|
413
|
+
var envelope = await queue.ConsumeAsync("orders-queue");
|
|
414
|
+
|
|
415
|
+
// Link consumer to producer's trace
|
|
416
|
+
var ctx = SentrySdk.ContinueTrace(envelope.SentryTrace, envelope.Baggage, name: "process-order", operation: "function");
|
|
417
|
+
var transaction = SentrySdk.StartTransaction(ctx);
|
|
418
|
+
|
|
419
|
+
var processSpan = transaction.StartChild("queue.process", "orders");
|
|
420
|
+
processSpan.SetData("messaging.message.id", envelope.MessageId);
|
|
421
|
+
processSpan.SetData("messaging.destination.name", "orders-queue");
|
|
422
|
+
processSpan.SetData("messaging.message.receive.latency", latencyMs);
|
|
423
|
+
processSpan.SetData("messaging.message.retry.count", retryCount);
|
|
424
|
+
|
|
425
|
+
try
|
|
426
|
+
{
|
|
427
|
+
await ProcessOrderAsync(envelope.Payload);
|
|
428
|
+
processSpan.Finish(SpanStatus.Ok);
|
|
429
|
+
transaction.Finish(SpanStatus.Ok);
|
|
430
|
+
}
|
|
431
|
+
catch (Exception ex)
|
|
432
|
+
{
|
|
433
|
+
processSpan.Finish(ex);
|
|
434
|
+
SentrySdk.CaptureException(ex);
|
|
435
|
+
transaction.Finish(ex);
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
## OpenTelemetry Integration
|
|
442
|
+
|
|
443
|
+
Sentry offers two ways to integrate with OpenTelemetry:
|
|
444
|
+
|
|
445
|
+
1. **OTLP Export (Recommended)** — Send OTel traces directly to Sentry’s OTLP endpoint
|
|
446
|
+
using standard protocol.
|
|
447
|
+
Added in 6.5.0.
|
|
448
|
+
2. **Bridge Pattern** — Convert OTel spans to Sentry’s proprietary format via a span
|
|
449
|
+
processor. Available since 6.1.0.
|
|
450
|
+
|
|
451
|
+
**Use OTLP Export when:**
|
|
452
|
+
|
|
453
|
+
- Starting a new OTel integration
|
|
454
|
+
- You want standard OTLP protocol compliance
|
|
455
|
+
- You prefer letting OTel handle all instrumentation
|
|
456
|
+
|
|
457
|
+
**Use Bridge Pattern when:**
|
|
458
|
+
|
|
459
|
+
- You need to maintain compatibility with existing integrations
|
|
460
|
+
- You want to mix Sentry’s built-in instrumentations with OTel
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
### Option 1: OTLP Export (Recommended)
|
|
465
|
+
|
|
466
|
+
> **Added in:** `Sentry` ≥6.5.0, `Sentry.OpenTelemetry.Exporter` ≥6.5.0
|
|
467
|
+
|
|
468
|
+
Sends OpenTelemetry traces directly to Sentry’s OTLP endpoint using the standard
|
|
469
|
+
OpenTelemetry Protocol.
|
|
470
|
+
This disables Sentry’s built-in tracing instrumentation — all span creation must be done
|
|
471
|
+
via OTel libraries.
|
|
472
|
+
|
|
473
|
+
#### Install
|
|
474
|
+
|
|
475
|
+
```bash
|
|
476
|
+
dotnet add package Sentry.OpenTelemetry.Exporter
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
#### Full ASP.NET Core Setup
|
|
480
|
+
|
|
481
|
+
```csharp
|
|
482
|
+
using OpenTelemetry.Trace;
|
|
483
|
+
|
|
484
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
485
|
+
|
|
486
|
+
// Part 1: Configure Sentry with UseOtlp()
|
|
487
|
+
builder.WebHost.UseSentry(options =>
|
|
488
|
+
{
|
|
489
|
+
options.Dsn = "https://...@o0.ingest.sentry.io/...";
|
|
490
|
+
options.TracesSampleRate = 1.0;
|
|
491
|
+
options.UseOtlp(); // ← disables Sentry tracing, enables OTel propagation context
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
// Part 2: Configure OTel TracerProvider with AddSentryOtlpExporter()
|
|
495
|
+
builder.Services.AddOpenTelemetry()
|
|
496
|
+
.WithTracing(tracing => tracing
|
|
497
|
+
.AddAspNetCoreInstrumentation()
|
|
498
|
+
.AddHttpClientInstrumentation()
|
|
499
|
+
.AddEntityFrameworkCoreInstrumentation()
|
|
500
|
+
.AddSentryOtlpExporter(builder.Configuration["Sentry:Dsn"]!) // ← sends spans via OTLP
|
|
501
|
+
);
|
|
502
|
+
|
|
503
|
+
var app = builder.Build();
|
|
504
|
+
app.Run();
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
#### Azure Functions (Isolated Worker)
|
|
508
|
+
|
|
509
|
+
```csharp
|
|
510
|
+
using Microsoft.Extensions.Hosting;
|
|
511
|
+
using Microsoft.Extensions.Logging;
|
|
512
|
+
using OpenTelemetry.Trace;
|
|
513
|
+
|
|
514
|
+
var host = new HostBuilder()
|
|
515
|
+
.ConfigureFunctionsWorkerDefaults()
|
|
516
|
+
.ConfigureLogging(logging =>
|
|
517
|
+
{
|
|
518
|
+
logging.AddSentry(options =>
|
|
519
|
+
{
|
|
520
|
+
options.Dsn = "https://...@o0.ingest.sentry.io/...";
|
|
521
|
+
options.TracesSampleRate = 1.0;
|
|
522
|
+
options.UseOtlp(); // ← required for OTLP mode
|
|
523
|
+
});
|
|
524
|
+
})
|
|
525
|
+
.ConfigureServices(services =>
|
|
526
|
+
{
|
|
527
|
+
services.AddOpenTelemetry().WithTracing(builder =>
|
|
528
|
+
{
|
|
529
|
+
builder
|
|
530
|
+
.AddHttpClientInstrumentation()
|
|
531
|
+
.AddSentryOtlpExporter(Environment.GetEnvironmentVariable("SENTRY_DSN")!);
|
|
532
|
+
});
|
|
533
|
+
})
|
|
534
|
+
.Build();
|
|
535
|
+
|
|
536
|
+
await host.RunAsync();
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
#### What `UseOtlp()` Does
|
|
540
|
+
|
|
541
|
+
- Sets `options.Instrumenter = Instrumenter.OpenTelemetry`
|
|
542
|
+
- Sets `options.DisableSentryTracing = true` — disables `SentryHttpMessageHandler`,
|
|
543
|
+
`DiagnosticSource` listeners, and EF Core interception
|
|
544
|
+
- Configures `ExternalPropagationContext` to read trace IDs from OTel `Activity`
|
|
545
|
+
|
|
546
|
+
**Critical:** All tracing must be done via OTel instrumentation libraries.
|
|
547
|
+
Sentry’s built-in span creation (`SentrySdk.StartTransaction()`, auto HTTP/DB spans) is
|
|
548
|
+
disabled.
|
|
549
|
+
|
|
550
|
+
#### Custom OTLP Endpoint
|
|
551
|
+
|
|
552
|
+
```csharp
|
|
553
|
+
// Use a custom OTLP collector instead of Sentry's endpoint
|
|
554
|
+
builder.Services.AddOpenTelemetry()
|
|
555
|
+
.WithTracing(tracing => tracing
|
|
556
|
+
.AddSentryOtlpExporter(
|
|
557
|
+
dsnString: builder.Configuration["Sentry:Dsn"]!,
|
|
558
|
+
collectorUrl: new Uri("https://custom-otel-collector.example.com/v1/traces")
|
|
559
|
+
)
|
|
560
|
+
);
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
#### ⚠️ Exception Capture
|
|
564
|
+
|
|
565
|
+
OTel’s exception APIs strip exception data before Sentry sees it.
|
|
566
|
+
Use Sentry’s or ILogger’s capture methods:
|
|
567
|
+
|
|
568
|
+
```csharp
|
|
569
|
+
// ❌ Loses exception details
|
|
570
|
+
activity.RecordException(ex);
|
|
571
|
+
|
|
572
|
+
// ✅ Use these instead
|
|
573
|
+
_logger.LogError(ex, "Something failed");
|
|
574
|
+
SentrySdk.CaptureException(ex);
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
### Option 2: Bridge Pattern
|
|
580
|
+
|
|
581
|
+
> **Added in:** `Sentry.OpenTelemetry` ≥3.34.0 (brings in `Sentry` transitively)
|
|
582
|
+
|
|
583
|
+
Registers a `SentrySpanProcessor` that converts OTel spans to Sentry’s proprietary
|
|
584
|
+
transaction/span format before sending.
|
|
585
|
+
Use when you need compatibility with existing Sentry integrations or want to mix
|
|
586
|
+
instrumentation approaches.
|
|
587
|
+
|
|
588
|
+
#### Version Requirements
|
|
589
|
+
|
|
590
|
+
| Package | Minimum Version |
|
|
591
|
+
| ---------------------- | --------------- |
|
|
592
|
+
| `Sentry.OpenTelemetry` | 3.34.0 |
|
|
593
|
+
| `OpenTelemetry` | 1.5.0 |
|
|
594
|
+
|
|
595
|
+
```bash
|
|
596
|
+
dotnet add package Sentry.OpenTelemetry
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
#### How It Works
|
|
600
|
+
|
|
601
|
+
The `AddSentry()` extension registers a `SentrySpanProcessor` with the OTel
|
|
602
|
+
`TracerProvider`. Span mapping:
|
|
603
|
+
|
|
604
|
+
- The **first** OTel `Span` flowing through the processor becomes a Sentry
|
|
605
|
+
**Transaction**
|
|
606
|
+
- **Child** OTel `Span`s with the same parent become Sentry **child Spans** on that
|
|
607
|
+
transaction
|
|
608
|
+
- A new top-level OTel `Span` from a different service creates a new Sentry
|
|
609
|
+
**Transaction**, linked via the same distributed trace
|
|
610
|
+
|
|
611
|
+
#### Full ASP.NET Core Setup
|
|
612
|
+
|
|
613
|
+
Two parts are required — both must be configured:
|
|
614
|
+
|
|
615
|
+
```csharp
|
|
616
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
617
|
+
|
|
618
|
+
// Part 1: Configure Sentry with UseOpenTelemetry()
|
|
619
|
+
builder.WebHost.UseSentry(options =>
|
|
620
|
+
{
|
|
621
|
+
options.Dsn = "https://...@o0.ingest.sentry.io/...";
|
|
622
|
+
options.TracesSampleRate = 1.0;
|
|
623
|
+
options.UseOpenTelemetry(); // ← tells Sentry to use OTel for trace context propagation
|
|
624
|
+
// Do NOT also configure Sentry's own DiagnosticSource integration —
|
|
625
|
+
// let OTel instrumentation libraries handle it instead
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
// Part 2: Register OTel TracerProvider with AddSentry()
|
|
629
|
+
builder.Services.AddOpenTelemetry()
|
|
630
|
+
.WithTracing(tracing => tracing
|
|
631
|
+
.AddAspNetCoreInstrumentation()
|
|
632
|
+
.AddHttpClientInstrumentation()
|
|
633
|
+
.AddEntityFrameworkCoreInstrumentation()
|
|
634
|
+
.AddSentry() // ← converts OTel spans to Sentry format
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
var app = builder.Build();
|
|
638
|
+
app.Run();
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
#### ⚠️ Exception Capture
|
|
642
|
+
|
|
643
|
+
**Do NOT use OTel’s exception APIs** — they strip exception data before Sentry can see
|
|
644
|
+
it:
|
|
645
|
+
|
|
646
|
+
```csharp
|
|
647
|
+
// ❌ These lose exception details
|
|
648
|
+
activity.RecordException(ex);
|
|
649
|
+
activity.AddException(ex);
|
|
650
|
+
|
|
651
|
+
// ✅ Use these instead
|
|
652
|
+
_logger.LogError(ex, "Something went wrong"); // ILogger (Sentry captures via logging integration)
|
|
653
|
+
SentrySdk.CaptureException(ex); // or capture directly
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## Dynamic Sampling
|
|
659
|
+
|
|
660
|
+
Sentry’s dynamic sampling uses the **Dynamic Sampling Context (DSC)** carried in
|
|
661
|
+
`baggage` to make consistent sampling decisions across a distributed trace.
|
|
662
|
+
|
|
663
|
+
### How It Works
|
|
664
|
+
|
|
665
|
+
1. The **head service** (first in the trace) makes the sampling decision.
|
|
666
|
+
2. The decision is encoded in `baggage` as `sentry-sampled=true|false`.
|
|
667
|
+
3. All downstream services receive `baggage` and honor the upstream decision.
|
|
668
|
+
4. DSC fields: `sentry-trace_id`, `sentry-public_key`, `sentry-sample_rate`,
|
|
669
|
+
`sentry-sampled`, `sentry-release`, `sentry-environment`, `sentry-transaction`,
|
|
670
|
+
`sentry-user_segment`.
|
|
671
|
+
|
|
672
|
+
### `TransactionNameSource` — Critical for Grouping
|
|
673
|
+
|
|
674
|
+
High-cardinality names (raw URLs) break dynamic sampling grouping.
|
|
675
|
+
Use parameterized routes:
|
|
676
|
+
|
|
677
|
+
```csharp
|
|
678
|
+
// ❌ Raw URL — creates unbounded unique groups, defeats sampling
|
|
679
|
+
SentrySdk.StartTransaction("/users/12345/orders/9876", "http.server");
|
|
680
|
+
|
|
681
|
+
// ✅ Parameterized — clean grouping, correct dynamic sampling
|
|
682
|
+
SentrySdk.StartTransaction(new TransactionContext(
|
|
683
|
+
"/users/{userId}/orders/{orderId}",
|
|
684
|
+
"http.server",
|
|
685
|
+
nameSource: TransactionNameSource.Route
|
|
686
|
+
));
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
| `TransactionNameSource` | Cardinality | Use For |
|
|
690
|
+
| ----------------------- | ----------- | ------------------------------------------------------- |
|
|
691
|
+
| `Route` | Low ✅ | Parameterized route templates (e.g., `GET /users/{id}`) |
|
|
692
|
+
| `Custom` | Low ✅ | User-defined names (background jobs, tasks) |
|
|
693
|
+
| `View` | Low ✅ | Controller / view class names |
|
|
694
|
+
| `Component` | Medium | Function / component names |
|
|
695
|
+
| `Url` | High ❌ | Raw URLs — avoid for dynamic sampling |
|
|
696
|
+
| `Task` | Low ✅ | Background task names |
|
|
697
|
+
|
|
698
|
+
---
|
|
699
|
+
|
|
700
|
+
## Operation Types and Naming Conventions
|
|
701
|
+
|
|
702
|
+
The `operation` string categorizes and color-codes spans in the Sentry UI. Follow these
|
|
703
|
+
conventions:
|
|
704
|
+
|
|
705
|
+
| Category | Operation | Example Description |
|
|
706
|
+
| --------------- | ------------------ | --------------------------------------- |
|
|
707
|
+
| HTTP server | `http.server` | `GET /api/users` |
|
|
708
|
+
| HTTP client | `http.client` | `GET https://api.stripe.com/v1/charges` |
|
|
709
|
+
| DB query | `db.query` | `SELECT * FROM orders WHERE id = ?` |
|
|
710
|
+
| DB connection | `db.connection` | — |
|
|
711
|
+
| DB compile | `db.query.compile` | The LINQ/HQL expression |
|
|
712
|
+
| Cache read | `cache.get` | The cache key |
|
|
713
|
+
| Cache write | `cache.put` | The cache key |
|
|
714
|
+
| Queue publish | `queue.publish` | Queue or topic name |
|
|
715
|
+
| Queue consume | `queue.process` | Queue or topic name |
|
|
716
|
+
| Function | `function` | Function or method name |
|
|
717
|
+
| Background task | `task` | Task name |
|
|
718
|
+
| Serialization | `serialize` | — |
|
|
719
|
+
| Validation | `validation` | What is being validated |
|
|
720
|
+
| AI inference | `ai.*` | Model name |
|
|
721
|
+
|
|
722
|
+
### `Origin` Field
|
|
723
|
+
|
|
724
|
+
Indicates whether a span was created by auto-instrumentation or by your code:
|
|
725
|
+
|
|
726
|
+
| Value | Source |
|
|
727
|
+
| -------------------------- | -------------------------- |
|
|
728
|
+
| `auto.http.aspnetcore` | ASP.NET Core middleware |
|
|
729
|
+
| `auto.http.client` | `SentryHttpMessageHandler` |
|
|
730
|
+
| `auto.db.ef_core_listener` | EF Core DiagnosticSource |
|
|
731
|
+
| `auto.db.sql_listener` | SQLClient DiagnosticSource |
|
|
732
|
+
| `manual` | User code |
|
|
733
|
+
|
|
734
|
+
---
|
|
735
|
+
|
|
736
|
+
## Custom Measurements
|
|
737
|
+
|
|
738
|
+
Attach numeric measurements to transactions (requires `Sentry` ≥3.23.0):
|
|
739
|
+
|
|
740
|
+
```csharp
|
|
741
|
+
var span = SentrySdk.GetSpan();
|
|
742
|
+
if (span != null)
|
|
743
|
+
{
|
|
744
|
+
var transaction = span.GetTransaction();
|
|
745
|
+
|
|
746
|
+
transaction.SetMeasurement("memory_used", 64, MeasurementUnit.Information.Megabyte);
|
|
747
|
+
transaction.SetMeasurement("profile_loading_time", 1.3, MeasurementUnit.Duration.Second);
|
|
748
|
+
transaction.SetMeasurement("items_processed", 1500); // unitless
|
|
749
|
+
transaction.SetMeasurement("cache_hit_rate", 0.85, MeasurementUnit.Fraction.Ratio);
|
|
750
|
+
}
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
### `MeasurementUnit` Quick Reference
|
|
754
|
+
|
|
755
|
+
| Category | Values |
|
|
756
|
+
| ----------- | ------------------------------------------------------------------------------------- |
|
|
757
|
+
| Duration | `Nanosecond`, `Microsecond`, `Millisecond`, `Second`, `Minute`, `Hour`, `Day`, `Week` |
|
|
758
|
+
| Information | `Bit`, `Byte`, `Kilobyte`/`Kibibyte`, `Megabyte`/`Mebibyte`, `Gigabyte`/`Gibibyte`, … |
|
|
759
|
+
| Fraction | `Ratio`, `Percent` |
|
|
760
|
+
| Unitless | Omit unit parameter |
|
|
761
|
+
|
|
762
|
+
> **⚠️ Unit consistency:** `("latency", 60, Second)` and `("latency", 3, Minute)` are
|
|
763
|
+
> stored as **separate measurements**, not aggregated.
|
|
764
|
+
> Always use the same unit per measurement name.
|
|
765
|
+
|
|
766
|
+
---
|
|
767
|
+
|
|
768
|
+
## `SpanStatus` Reference
|
|
769
|
+
|
|
770
|
+
```csharp
|
|
771
|
+
SpanStatus.Ok // success
|
|
772
|
+
SpanStatus.Cancelled // OperationCanceledException
|
|
773
|
+
SpanStatus.InvalidArgument // ArgumentException, bad input
|
|
774
|
+
SpanStatus.DeadlineExceeded // TimeoutException
|
|
775
|
+
SpanStatus.NotFound // 404
|
|
776
|
+
SpanStatus.PermissionDenied // UnauthorizedAccessException, 403
|
|
777
|
+
SpanStatus.ResourceExhausted // 429 / out of resources
|
|
778
|
+
SpanStatus.Unimplemented // NotImplementedException, 501
|
|
779
|
+
SpanStatus.Unavailable // 503
|
|
780
|
+
SpanStatus.InternalError // unhandled exception, 500
|
|
781
|
+
SpanStatus.UnknownError // unknown failure
|
|
782
|
+
SpanStatus.FailedPrecondition // InvalidOperationException
|
|
783
|
+
SpanStatus.Aborted // conflicting operation
|
|
784
|
+
SpanStatus.DataLoss // unrecoverable data loss
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
`span.Finish(exception)` auto-maps exception type → `SpanStatus`. HTTP status codes from
|
|
788
|
+
`SentryHttpMessageHandler` are also mapped automatically (`2xx→Ok`,
|
|
789
|
+
`401→Unauthenticated`, `403→PermissionDenied`, `404→NotFound`, `429→ResourceExhausted`,
|
|
790
|
+
`5xx→InternalError`).
|
|
791
|
+
|
|
792
|
+
---
|
|
793
|
+
|
|
794
|
+
## Complete Configuration Reference
|
|
795
|
+
|
|
796
|
+
```csharp
|
|
797
|
+
SentrySdk.Init(options =>
|
|
798
|
+
{
|
|
799
|
+
// ── Identity ──────────────────────────────────────────────────────────
|
|
800
|
+
options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
|
|
801
|
+
options.Environment = "production";
|
|
802
|
+
options.Release = "my-app@1.2.3";
|
|
803
|
+
|
|
804
|
+
// ── Tracing ───────────────────────────────────────────────────────────
|
|
805
|
+
options.TracesSampleRate = 0.2; // 20% uniform rate
|
|
806
|
+
|
|
807
|
+
// OR dynamic sampler (takes precedence when set)
|
|
808
|
+
options.TracesSampler = ctx =>
|
|
809
|
+
{
|
|
810
|
+
if (ctx.TransactionContext.Name.Contains("/health")) return 0.0;
|
|
811
|
+
return 0.1;
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
// Restrict which outbound hosts receive trace headers (default: all)
|
|
815
|
+
options.TracePropagationTargets = new List<StringOrRegex>
|
|
816
|
+
{
|
|
817
|
+
"api.mycompany.internal",
|
|
818
|
+
new StringOrRegex(new Regex(@"^https://.*\.mycompany\.com")),
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
// ── Auto-instrumentation control ──────────────────────────────────────
|
|
822
|
+
// options.DisableDiagnosticSourceIntegration(); // opt out of EF Core / SQLClient spans
|
|
823
|
+
|
|
824
|
+
// ── OpenTelemetry (optional) ──────────────────────────────────────────
|
|
825
|
+
// options.UseOpenTelemetry(); // use when routing spans via OTel TracerProvider
|
|
826
|
+
|
|
827
|
+
// ── Profiling (Alpha, .NET 8+ only) ───────────────────────────────────
|
|
828
|
+
// options.ProfilesSampleRate = 0.1;
|
|
829
|
+
// options.AddProfilingIntegration(TimeSpan.FromMilliseconds(500)); // sync startup
|
|
830
|
+
});
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
### Key Options Table
|
|
834
|
+
|
|
835
|
+
| Option | Type | Default | Purpose |
|
|
836
|
+
| -------------------------------------- | ------------------------------------------- | ----------------- | ----------------------------------------------------- |
|
|
837
|
+
| `TracesSampleRate` | `double?` | `null` (disabled) | Uniform sampling rate 0.0–1.0 |
|
|
838
|
+
| `TracesSampler` | `Func<TransactionSamplingContext, double?>` | `null` | Dynamic sampler; overrides `TracesSampleRate` |
|
|
839
|
+
| `TracePropagationTargets` | `IList<StringOrRegex>` | `[".*"]` (all) | Hosts that receive `sentry-trace` + `baggage` headers |
|
|
840
|
+
| `SendDefaultPii` | `bool` | `false` | Include user IP and username in transactions |
|
|
841
|
+
| `ProfilesSampleRate` | `double?` | `null` | Profiling rate relative to traced transactions |
|
|
842
|
+
| `UseOpenTelemetry()` | method | — | Enable OTel-based trace context propagation |
|
|
843
|
+
| `DisableDiagnosticSourceIntegration()` | method | — | Opt out of EF Core / SQLClient auto-spans |
|
|
844
|
+
|
|
845
|
+
---
|
|
846
|
+
|
|
847
|
+
## Quick Reference Cheat Sheet
|
|
848
|
+
|
|
849
|
+
```csharp
|
|
850
|
+
// ── Start a root transaction ──────────────────────────────────────────────
|
|
851
|
+
var tx = SentrySdk.StartTransaction("name", "operation");
|
|
852
|
+
SentrySdk.ConfigureScope(s => s.Transaction = tx); // link errors + enable auto-spans
|
|
853
|
+
|
|
854
|
+
// ── Add child spans ───────────────────────────────────────────────────────
|
|
855
|
+
var span = tx.StartChild("operation", "description");
|
|
856
|
+
span.SetData("key", "value");
|
|
857
|
+
span.Finish(SpanStatus.Ok);
|
|
858
|
+
|
|
859
|
+
// ── Get the active span from anywhere ────────────────────────────────────
|
|
860
|
+
var active = SentrySdk.GetSpan();
|
|
861
|
+
var child = active?.StartChild("nested-op");
|
|
862
|
+
child?.Finish();
|
|
863
|
+
|
|
864
|
+
// ── Access the transaction from a span ───────────────────────────────────
|
|
865
|
+
var txFromSpan = active?.GetTransaction();
|
|
866
|
+
txFromSpan?.SetMeasurement("count", 42, MeasurementUnit.Duration.Millisecond);
|
|
867
|
+
|
|
868
|
+
// ── Finish variants ───────────────────────────────────────────────────────
|
|
869
|
+
tx.Finish(); // implicit Ok
|
|
870
|
+
tx.Finish(SpanStatus.InternalError); // explicit status
|
|
871
|
+
tx.Finish(exception); // auto-maps exception → SpanStatus
|
|
872
|
+
|
|
873
|
+
// ── Distributed tracing: outgoing headers ─────────────────────────────────
|
|
874
|
+
var traceHeader = SentrySdk.GetTraceHeader()?.ToString(); // "sentry-trace" value
|
|
875
|
+
var baggage = SentrySdk.GetBaggage()?.ToString(); // "baggage" value
|
|
876
|
+
var traceparent = SentrySdk.GetTraceparentHeader()?.ToString(); // W3C format
|
|
877
|
+
|
|
878
|
+
// ── Distributed tracing: incoming headers ─────────────────────────────────
|
|
879
|
+
var ctx = SentrySdk.ContinueTrace(incomingTraceHeader, incomingBaggageHeader, name: "name", operation: "op");
|
|
880
|
+
var linked = SentrySdk.StartTransaction(ctx);
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
---
|
|
884
|
+
|
|
885
|
+
## Troubleshooting
|
|
886
|
+
|
|
887
|
+
| Issue | Likely Cause | Fix |
|
|
888
|
+
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
|
|
889
|
+
| No transactions appear in Sentry | `TracesSampleRate` and `TracesSampler` are both unset | Set `options.TracesSampleRate = 1.0` (or `>0`) during `SentrySdk.Init()` |
|
|
890
|
+
| Transactions appear but have no child spans | Transaction not set on scope | Call `SentrySdk.ConfigureScope(s => s.Transaction = tx)` after starting the transaction |
|
|
891
|
+
| Outgoing HTTP spans missing | `HttpClient` created manually without `SentryHttpMessageHandler` | Use `IHttpClientFactory`, or wrap with `new HttpClient(new SentryHttpMessageHandler())` |
|
|
892
|
+
| EF Core spans missing | `Sentry.DiagnosticSource` not installed or version < 3.9.0 | Install `Sentry.DiagnosticSource`, or upgrade `Sentry.AspNetCore` to ≥3.9.0 |
|
|
893
|
+
| Distributed trace not connected across services | Missing `ContinueTrace()` on receiving end | Call `SentrySdk.ContinueTrace(traceHeader, baggageHeader)` and use the returned context to start the transaction |
|
|
894
|
+
| `sentry-trace` header stripped by browser preflight | CORS policy blocks non-simple headers | Add `sentry-trace` and `baggage` to `Access-Control-Allow-Headers` in your CORS config |
|
|
895
|
+
| OTel spans not appearing in Sentry | `AddSentry()` missing from `TracerProvider` OR `UseOpenTelemetry()` missing from `SentryOptions` | Both are required: `AddSentry()` in OTel builder AND `options.UseOpenTelemetry()` in Sentry init |
|
|
896
|
+
| OTel mode: exceptions captured with no context | Using `activity.RecordException()` or `activity.AddException()` | Use `SentrySdk.CaptureException(ex)` or `_logger.LogError(ex, ...)` instead |
|
|
897
|
+
| High-cardinality transaction groups | Transaction names are raw URLs | Use `TransactionNameSource.Route` with parameterized route templates |
|