Skip to content

Commit

Permalink
chore: dotnet profiling tuneups (#9081)
Browse files Browse the repository at this point in the history
* chore: dotnet profiling tuneups

* Apply suggestions from code review

Co-authored-by: vivianyentran <[email protected]>

* fixup

---------

Co-authored-by: vivianyentran <[email protected]>
  • Loading branch information
vaind and vivianyentran committed Feb 8, 2024
1 parent 4814d67 commit 4b0485f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,31 @@ dotnet add package Sentry.Profiling --prerelease

Profiling depends on Sentry’s performance monitoring product being enabled beforehand. To enable performance monitoring in the SDK, set the `TracesSampleRate` option to the desired value.

```csharp {tabTitle:iOS/MacCatalyst}
```csharp {tabTitle:Windows/Linux/macOS}
SentrySdk.Init(options =>
{
// ... usual setup options omitted for clarity (see Getting Started) ...
// Sample rate for your transactions, e.g. value 0.1 means we want to report 10% of transactions.
// Setting 1.0 means all transactions are profiled.
// We recommend adjusting this value in production.
options.TracesSampleRate = 1.0;

// Sample rate for profiling, applied on top of othe TracesSampleRate,
// e.g. 0.2 means we want to profile 20 % of the captured transactions.
// We recommend adjusting this value in production.
options.ProfilesSampleRate = 1.0;

// Requires NuGet package: Sentry.Profiling
// Note: By default, the profiler is initialized asynchronously. This can be tuned by passing a desired initialization timeout to the constructor.
options.AddIntegration(new ProfilingIntegration(
// During startup, wait up to 500ms to profile the app startup code. This could make launching the app a bit slower so comment it out if your prefer profiling to start asynchronously
TimeSpan.FromMilliseconds(500)
));
});
```

```csharp {tabTitle:Windows/Linux/macOS}
```csharp {tabTitle:iOS/MacCatalyst}
SentrySdk.Init(options =>
{
// ... usual setup options omitted for clarity (see Getting Started) ...
Expand All @@ -61,13 +69,6 @@ SentrySdk.Init(options =>
// e.g. 0.2 means we want to profile 20 % of the captured transactions.
// We recommend adjusting this value in production.
options.ProfilesSampleRate = 1.0;

// Requires NuGet package: Sentry.Profiling
// Note: by default, the profiler is initialized asynchronously, this can be tuned by passing an desired initialization timeout to the constructor.
options.AddIntegration(new ProfilingIntegration(
// During startup, wait up to 500ms to profile the app startup code. This could make launching the app a bit slower so comment it out if your prefer profiling to start asynchronously
TimeSpan.FromMilliseconds(500)
));
});
```

Expand Down
2 changes: 1 addition & 1 deletion docs/product/profiling/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Profiling depends on Sentry's performance monitoring product being enabled befor
- [iOS](/platforms/apple/guides/ios/profiling/)
- [React Native](/platforms/react-native/profiling/) [beta]
- [Flutter](/platforms/flutter/profiling/) [experimental, iOS and macOS only]
- [.NET](/platforms/dotnet/profiling/) [experimental, iOS only]
- [.NET](/platforms/dotnet/guides/maui/profiling/) [experimental, iOS only]
- Standalone and server apps
- [.NET](/platforms/dotnet/profiling/) [experimental]
- [Node.js](/platforms/node/profiling/)
Expand Down

0 comments on commit 4b0485f

Please sign in to comment.