Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiagnosticSource Integration disabled incorrectly when using a TracesSampler #2038

Closed
mattjohnsonpint opened this issue Nov 9, 2022 · 1 comment · Fixed by #2039
Closed
Assignees
Labels
Bug Something isn't working DiagnosticSource

Comments

@mattjohnsonpint
Copy link
Contributor

mattjohnsonpint commented Nov 9, 2022

Package

Sentry

SDK Version

3.23.1

Steps to Reproduce

Set a TracesSampler that returns 1.0, without setting TracesSampleRate.

Expected Result

Since the TracesSampler prevails, database transactions should be instrumented.

Actual Result

Notice in the logs:

DiagnosticSource Integration is now disabled due to TracesSampleRate being set to zero.

Database transactions are not instrumented at all, because the integration is disabled.

@mattjohnsonpint mattjohnsonpint added Bug Something isn't working Platform: .NET labels Nov 9, 2022
@mattjohnsonpint
Copy link
Contributor Author

Caused here:

if (options.TracesSampleRate == 0)
{
options.Log(SentryLevel.Info, "DiagnosticSource Integration is now disabled due to TracesSampleRate being set to zero.");
options.DisableDiagnosticSourceIntegration();
return;
}

This should only be done if the TracesSampleRate is 0 and the TracesSampler option is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working DiagnosticSource
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant