SqlClient integration in ASP.NET (.NET 4.8) application - no spans generated #1967
-
Hello, I'm running a .NET 4.8 ASP.NET MVC application and I'd like to use the built-in SqlClient integration described here to generate spans for SQL operations. I'm calling both An action method in my controller throws a I have tried switching from What do I need to do to make the SqlClient integration work correctly? Thank you! Referenced Sentry packages:
Excerpt from _sentry = SentrySdk.Init(o =>
{
o.Dsn = Config.SentryDsn;
o.Environment = Config.EnvironmentName;
o.SendDefaultPii = true;
o.AddAspNet(RequestSize.Always);
o.AddDiagnosticSourceIntegration();
o.TracesSampleRate = Config.SentryTracesSampleRate; //set to 1.0
o.BeforeSend = sentryEvent =>
{
var httpCode = (sentryEvent.Exception as HttpException)?.GetHttpCode();
if (httpCode == 404)
{
sentryEvent.Level = SentryLevel.Info;
}
return sentryEvent;
};
}); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@nixxcz unfortunately we cant support DiagnosticSource integration for SqlClient on net48 because the underlying SqlClient only supports DiagnosticSource on netcore. I have raise a docs PR to clarify this https://github.com/getsentry/sentry-docs/pull/5611/files |
Beta Was this translation helpful? Give feedback.
@nixxcz unfortunately we cant support DiagnosticSource integration for SqlClient on net48 because the underlying SqlClient only supports DiagnosticSource on netcore. I have raise a docs PR to clarify this https://github.com/getsentry/sentry-docs/pull/5611/files