From b6ec32e56a4d92807f075514bb07191aaca8c0e0 Mon Sep 17 00:00:00 2001 From: Scott Opell Date: Fri, 10 Nov 2023 11:01:45 -0500 Subject: [PATCH] Removes periodic re-init of statsd reporter (#422) --- .../datadog/jmxfetch/reporter/StatsdReporter.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/main/java/org/datadog/jmxfetch/reporter/StatsdReporter.java b/src/main/java/org/datadog/jmxfetch/reporter/StatsdReporter.java index 68e3890cf..8ce63eeae 100644 --- a/src/main/java/org/datadog/jmxfetch/reporter/StatsdReporter.java +++ b/src/main/java/org/datadog/jmxfetch/reporter/StatsdReporter.java @@ -17,7 +17,6 @@ public class StatsdReporter extends Reporter { private int statsdPort; private Boolean telemetry; private int queueSize; - private long initializationTime; private boolean nonBlocking; private int socketBufferSize; private int socketTimeout; @@ -37,8 +36,6 @@ public StatsdReporter(String statsdHost, int statsdPort, boolean telemetry, int } private void init() { - initializationTime = System.currentTimeMillis(); - // Only set the entityId to "none" if UDS communication is activated String entityId = this.statsdPort == 0 ? "none" : null; int defaultUdsDatagramSize = 8192; @@ -99,10 +96,6 @@ private void init() { protected void sendMetricPoint( String metricType, String metricName, double value, String[] tags) { - if (System.currentTimeMillis() - this.initializationTime > 300 * 1000) { - this.statsDClient.stop(); - init(); - } if (metricType.equals("monotonic_count")) { statsDClient.count(metricName, (long) value, tags); } else if (metricType.equals("histogram")) { @@ -115,11 +108,6 @@ protected void sendMetricPoint( /** Submits service check. */ public void doSendServiceCheck( String serviceCheckName, String status, String message, String[] tags) { - if (System.currentTimeMillis() - this.initializationTime > 300 * 1000) { - this.statsDClient.stop(); - init(); - } - ServiceCheck sc = ServiceCheck.builder() .withName(serviceCheckName) .withStatus(this.statusToServiceCheckStatus(status))