getsentry / getsentry/sentry-dotnet

Instrument SqlClient on NetFx via ETW

Open
#1,974 3 comments 3 reactions 0 assignees View on GitHub
.NET .NET Framework Feature
Dominant language
C#
Stars
770
Forks
248
Avg merge
3d 4h
Merged PRs (30d)
49

Description

### Problem Statement

We currently have automatic instrumentation for tracing queries from SqlClient. However, this doesn't work on .NET Framework because the `SqlClientDiagnosticListener` is only available for .NET Core (see [https://github.com/dotnet/SqlClient/issues/1529]()).

Customers have asked for this. See [https://github.com/getsentry/sentry-dotnet/discussions/1967]()

### Solution Brainstorm

SqlClient on .NET Framework *can* be instrumented, just via `EventSource` (ETW) rather than DiagnosticSource. There's an example here:
[https://learn.microsoft.com/sql/connect/ado-net/enable-eventsource-tracing#example]()

The output is a bit different though, so it would take some investigative work to create something as robust as our current [`SentrySqlListener`]() - but it should be doable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.