Skip to content

Commit fd659bb

Browse files
author
Yang Zeng
committed
MONIT-40224: fix error span
1 parent 588983a commit fd659bb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

proxy/src/main/java/com/wavefront/agent/sampler/EbpfSampler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.wavefront.agent.sampler;
22

3-
import static com.wavefront.common.TraceConstants.PARENT_KEY;
43
import static com.wavefront.sdk.common.Constants.*;
54

65
import com.github.benmanes.caffeine.cache.Caffeine;
@@ -16,7 +15,6 @@
1615
import java.util.logging.Logger;
1716
import java.util.stream.Collectors;
1817
import javax.annotation.Nonnull;
19-
import org.apache.commons.lang.StringUtils;
2018
import wavefront.report.Annotation;
2119
import wavefront.report.Span;
2220

@@ -139,7 +137,7 @@ public boolean sample(@Nonnull Span span) {
139137
stats.edgeCount.getAndIncrement();
140138
if (!stats.isSignificant()) sampled = true;
141139

142-
if (annotationMap.containsKey(ERROR_TAG_KEY)) {
140+
if (annotationMap.containsKey(ERROR_TAG_KEY) && "true".equalsIgnoreCase(annotationMap.get(ERROR_TAG_KEY))) {
143141
stats.errorCount.getAndIncrement();
144142
if (!sampled && stats.getErrorRatio() < 0.5) sampled = true;
145143
}

0 commit comments

Comments
 (0)