From 98e733fb825e39b3cc712681bddb06deb69143e6 Mon Sep 17 00:00:00 2001 From: Igor Unanua Date: Thu, 9 Jan 2025 15:16:36 +0100 Subject: [PATCH] Log when setting priority on a noop span (#5086) --- packages/dd-trace/src/priority_sampler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/dd-trace/src/priority_sampler.js b/packages/dd-trace/src/priority_sampler.js index 7497f1f919c..a054a82f668 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