diff --git a/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java b/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java index 9f56dc4db1cc..e93d24a0f949 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java @@ -560,11 +560,12 @@ private CoreTracer( // Get initial Trace Sampling Rules from config String traceSamplingRulesJson = config.getTraceSamplingRules(); - TraceSamplingRules traceSamplingRules = TraceSamplingRules.EMPTY; - if (traceSamplingRulesJson != null) { - traceSamplingRules = TraceSamplingRules.deserialize(traceSamplingRulesJson); - } else { + TraceSamplingRules traceSamplingRules; + if (traceSamplingRulesJson == null) { traceSamplingRulesJson = "[]"; + traceSamplingRules = TraceSamplingRules.EMPTY; + } else { + traceSamplingRules = TraceSamplingRules.deserialize(traceSamplingRulesJson); } // Get initial Span Sampling Rules from config String spanSamplingRulesJson = config.getSpanSamplingRules();