Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Log warning if both tracesSampleRate and tracesSampler are set
  • Loading branch information
buenaflor committed Oct 25, 2023
commit b15944e1766eef318f0460ccfee1e1d8886eedc9
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.');
}
}

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