Skip to content

Commit 8403401

Browse files
lucas-zimermanimatwawanabruno-garcia
authored
Refactor DiagnosticSource docs. (#4140)
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
1 parent 0c9a0d7 commit 8403401

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

src/includes/performance/automatic-instrumentation-integrations/dotnet.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## DiagnosticSource Integration
2+
3+
Starting with version 3.9.0, the SDK automatically integrates with Entity Framework Core and SQLClient whenever available. Those integrations are automatically activated if your project matches one of the following conditions:
4+
5+
* Includes `Sentry.AspNet` 3.9.0 or higher
6+
* Includes `Sentry.AspNetCore` 3.9.0 or higher
7+
* Includes `Sentry` 3.9.0 and targets .NET Core 3.0 or higher (for example, .NET 5)
8+
9+
If you don't want to have this integration, you can disable it on `SentryOptions` by calling `DisableDiagnosticSourceIntegration();`
10+
11+
```csharp
12+
using Sentry;
13+
14+
option.DisableDiagnosticSourceIntegration();
15+
```
16+
17+
If your project doesn't match any of the conditions above, (for example, it targets .NET Framework 4.6.1 and uses only the `Sentry` package), you can still manually activate those instrumentations by including the package `Sentry.DiagnosticSource` and enabling it during on the SDK's initialization.
18+
19+
```csharp
20+
// Requires NuGet package: Sentry.DiagnosticSource
21+
using Sentry;
22+
23+
option.AddDiagnosticSourceIntegration();
24+
```
125
### Entity Framework Core Integration
226

327
![Sample transaction with Entity Framework Core Integration.](dotnet-ef-core-integration.png)

src/platforms/dotnet/common/performance/instrumentation/automatic-instrumentation.mdx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,4 @@ var sentryHttpHandler = new SentryHttpMessageHandler(innerHttpHandler);
3838
var httpClient = new HttpClient(sentryHttpHandler);
3939
```
4040

41-
## DiagnosticSource Integration
42-
43-
Starting with version 3.9.0, the SDK will automatically integrate with Entity Framework Core and SQLClient whenever available. Those integrations will automatically be activated if your project matches one of the following conditions:
44-
* Includes `Sentry.AspNet` 3.9.0 or higher
45-
* Includes `Sentry.AspNetCore` 3.9.0 or higher
46-
* Targets .NET Core 3.0 or higher (for example .NET 5)
47-
48-
Even if your project doesn't meet any of those requirements, you'll be able to manually activate those instrumentations by including the package 'Sentry.DiagnosticSource' and enabling it during on the SDK's initialization.
49-
50-
```csharp
51-
// Requires NuGet package: Sentry.DiagnosticSource
52-
option.AddDiagnosticSourceIntegration();
53-
54-
```
55-
56-
If you don't want to have this integration, you can disable it on `SentryOptions` by calling `DisableDiagnosticSourceIntegration();`
57-
```csharp
58-
option.DisableDiagnosticSourceIntegration();
59-
```
60-
6141
<PlatformContent includePath="performance/automatic-instrumentation-integrations" />

0 commit comments

Comments
 (0)