Skip to content

Commit 3f35463

Browse files
deejgregormhlidd
authored andcommitted
Use SEND_TELEMETRY for DumpDrain's index out of bounds warning log
1 parent 4b4bbc5 commit 3f35463

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dd-trace-core/src/main/java/datadog/trace/core/PendingTraceBuffer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package datadog.trace.core;
22

3+
import static datadog.trace.api.telemetry.LogCollector.SEND_TELEMETRY;
34
import static datadog.trace.util.AgentThreadFactory.AgentThread.TRACE_MONITOR;
45
import static datadog.trace.util.AgentThreadFactory.THREAD_JOIN_TIMOUT_MS;
56
import static datadog.trace.util.AgentThreadFactory.newAgentThread;
@@ -25,7 +26,6 @@
2526
import org.slf4j.LoggerFactory;
2627

2728
public abstract class PendingTraceBuffer implements AutoCloseable {
28-
private static final Logger LOGGER = LoggerFactory.getLogger(PendingTraceBuffer.class);
2929
private static final int BUFFER_SIZE = 1 << 12; // 4096
3030

3131
public boolean longRunningSpansEnabled() {
@@ -147,6 +147,7 @@ public void accept(Element pendingTrace) {
147147

148148
private static final class DumpDrain
149149
implements MessagePassingQueue.Consumer<Element>, MessagePassingQueue.Supplier<Element> {
150+
private static final Logger LOGGER = LoggerFactory.getLogger(DumpDrain.class);
150151
private static final DumpDrain DUMP_DRAIN = new DumpDrain();
151152
private static final int MAX_DUMPED_TRACES = 50;
152153

@@ -172,6 +173,7 @@ public Element get() {
172173
// MessagePassingQueue docs if we return a null. Return a stand-in
173174
// Element instead.
174175
LOGGER.warn(
176+
SEND_TELEMETRY,
175177
"Index {} is out of bounds for data size {} in DumpDrain.get so returning filler CommandElement to prevent pending trace queue from breaking.",
176178
index,
177179
data.size());

0 commit comments

Comments
 (0)