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

chore: log warning if both tracesSampleRate and tracesSampler are set #1701

Merged
merged 5 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Enhancements

- Log warning if both tracesSampleRate and tracesSampler are set ([#1701](https://github.com/getsentry/sentry-dart/pull/1701))

## 7.11.0

### Fixes
Expand Down
7 changes: 6 additions & 1 deletion dart/lib/src/sentry_traces_sampler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ class SentryTracesSampler {
SentryTracesSampler(
this._options, {
Random? random,
}) : _random = random ?? Random();
}) : _random = random ?? Random() {
if (_options.tracesSampler != null && _options.tracesSampleRate != null) {
_options.logger(SentryLevel.warning,
'Both tracesSampler and sampleRate are set - only tracesSampler will be used.');
buenaflor marked this conversation as resolved.
Show resolved Hide resolved
}
}

SentryTracesSamplingDecision sample(SentrySamplingContext samplingContext) {
final samplingDecision =
Expand Down