diff --git a/packages/dd-trace/src/priority_sampler.js b/packages/dd-trace/src/priority_sampler.js index 7497f1f919..a054a82f66 100644 --- a/packages/dd-trace/src/priority_sampler.js +++ b/packages/dd-trace/src/priority_sampler.js @@ -122,7 +122,10 @@ class PrioritySampler { const context = this._getContext(span) const root = context._trace.started[0] - if (!root) return // noop span + if (!root) { + log.error('Skipping the setPriority on noop span') + return // noop span + } context._sampling.priority = samplingPriority context._sampling.mechanism = mechanism