From 8096b9f06e68772b8e02bc719c3a5e1fce808872 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 25 Mar 2022 10:39:02 -0700 Subject: [PATCH] Fix statsbeat warning (#2208) --- .../agent/internal/telemetry/BatchSpanProcessor.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/telemetry/BatchSpanProcessor.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/telemetry/BatchSpanProcessor.java index b57bb7c749e..ec79b634aca 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/telemetry/BatchSpanProcessor.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/telemetry/BatchSpanProcessor.java @@ -277,10 +277,14 @@ private void exportCurrentBatch() { pendingExports.remove(result); }); } else { - addAsyncExport.recordFailure( - "Max number of concurrent exports " - + maxPendingExports - + " has been hit, may see some export throttling due to this"); + // need conditional, otherwise this will always get logged when maxPendingExports is 1 + // (e.g. statsbeat) + if (maxPendingExports > 1) { + addAsyncExport.recordFailure( + "Max number of concurrent exports " + + maxPendingExports + + " has been hit, may see some export throttling due to this"); + } result.join(exporterTimeoutNanos, TimeUnit.NANOSECONDS); } } finally {