From fd659bbfefe22943b22b00aac857c79da1be32f8 Mon Sep 17 00:00:00 2001 From: Yang Zeng <“zengyang@vmware.com”> Date: Wed, 8 Nov 2023 11:55:19 -0800 Subject: [PATCH] MONIT-40224: fix error span --- .../main/java/com/wavefront/agent/sampler/EbpfSampler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/proxy/src/main/java/com/wavefront/agent/sampler/EbpfSampler.java b/proxy/src/main/java/com/wavefront/agent/sampler/EbpfSampler.java index 8ab2b8536..9cc985a47 100644 --- a/proxy/src/main/java/com/wavefront/agent/sampler/EbpfSampler.java +++ b/proxy/src/main/java/com/wavefront/agent/sampler/EbpfSampler.java @@ -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; @@ -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; @@ -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; }