Skip to content

Commit

Permalink
MONIT-40224: fix error span
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Zeng committed Nov 8, 2023
1 parent 588983a commit fd659bb
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.wavefront.agent.sampler;

import static com.wavefront.common.TraceConstants.PARENT_KEY;
import static com.wavefront.sdk.common.Constants.*;

import com.github.benmanes.caffeine.cache.Caffeine;
Expand All @@ -16,7 +15,6 @@
import java.util.logging.Logger;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import org.apache.commons.lang.StringUtils;
import wavefront.report.Annotation;
import wavefront.report.Span;

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

if (annotationMap.containsKey(ERROR_TAG_KEY)) {
if (annotationMap.containsKey(ERROR_TAG_KEY) && "true".equalsIgnoreCase(annotationMap.get(ERROR_TAG_KEY))) {
stats.errorCount.getAndIncrement();
if (!sampled && stats.getErrorRatio() < 0.5) sampled = true;
}
Expand Down

0 comments on commit fd659bb

Please sign in to comment.