From 6bc77a8337f2d8d22ef51774f3c2736de2adea98 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Thu, 31 Aug 2023 09:36:40 -0400 Subject: [PATCH 01/10] draft display internal metrics on status --- src/main/java/org/datadog/jmxfetch/App.java | 3 ++- .../java/org/datadog/jmxfetch/Instance.java | 8 ++++++ .../java/org/datadog/jmxfetch/Status.java | 26 ++++++++++++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/datadog/jmxfetch/App.java b/src/main/java/org/datadog/jmxfetch/App.java index 680003c46..5bb6f9499 100644 --- a/src/main/java/org/datadog/jmxfetch/App.java +++ b/src/main/java/org/datadog/jmxfetch/App.java @@ -13,6 +13,7 @@ import org.datadog.jmxfetch.util.ByteArraySearcher; import org.datadog.jmxfetch.util.CustomLogger; import org.datadog.jmxfetch.util.FileHelper; +import org.datadog.jmxfetch.util.InstanceTelemetry; import org.datadog.jmxfetch.util.LogLevel; import org.datadog.jmxfetch.util.MetadataHelper; import org.datadog.jmxfetch.util.ServiceCheckHelper; @@ -755,7 +756,7 @@ private void reportStatus( stats.addInstanceStats( checkName, instance.getName(), metricCount, reporter.getServiceCheckCount(checkName), - message, status); + message, status, instance.getInstanceTelemetryBean(), instance.getInstanceTelemetryBeanName()); if (reporter.getHandler() != null) { stats.addErrorStats(reporter.getHandler().getErrors()); } diff --git a/src/main/java/org/datadog/jmxfetch/Instance.java b/src/main/java/org/datadog/jmxfetch/Instance.java index 71a315024..a4aed236b 100644 --- a/src/main/java/org/datadog/jmxfetch/Instance.java +++ b/src/main/java/org/datadog/jmxfetch/Instance.java @@ -827,6 +827,14 @@ public int getMaxNumberOfMetrics() { return this.maxReturnedMetrics; } + public InstanceTelemetry getInstanceTelemetryBean() { + return this.instanceTelemetryBean; + } + + public ObjectName getInstanceTelemetryBeanName() { + return this.instanceTelemetryBeanName; + } + /** Returns whether or not the instance has reached the maximum bean collection limit. */ public boolean isLimitReached() { return this.limitReached; diff --git a/src/main/java/org/datadog/jmxfetch/Status.java b/src/main/java/org/datadog/jmxfetch/Status.java index a2d73952e..1c35c979c 100644 --- a/src/main/java/org/datadog/jmxfetch/Status.java +++ b/src/main/java/org/datadog/jmxfetch/Status.java @@ -2,6 +2,8 @@ import com.fasterxml.jackson.jr.ob.JSON; import lombok.extern.slf4j.Slf4j; + +import org.datadog.jmxfetch.util.InstanceTelemetry; import org.datadog.jmxfetch.util.MetadataHelper; import org.yaml.snakeyaml.Yaml; @@ -15,6 +17,8 @@ import java.util.List; import java.util.Map; +import javax.management.ObjectName; + @Slf4j public class Status { @@ -73,7 +77,9 @@ public void addInstanceStats( int metricCount, int serviceCheckCount, String message, - String status) { + String status, + InstanceTelemetry instanceTelemetryBean, + ObjectName instanceTelemetryBeanName) { addStats( checkName, instance, @@ -81,7 +87,9 @@ public void addInstanceStats( serviceCheckCount, message, status, - INITIALIZED_CHECKS); + INITIALIZED_CHECKS, + instanceTelemetryBean, + instanceTelemetryBeanName); } public void addErrorStats(int errors) { @@ -96,7 +104,9 @@ private void addStats( int serviceCheckCount, String message, String status, - String key) { + String key, + InstanceTelemetry instanceTelemetryBean, + ObjectName instanceTelemetryBeanName) { List> checkStats; Map initializedChecks; initializedChecks = (Map) this.instanceStats.get(key); @@ -117,6 +127,14 @@ private void addStats( if (serviceCheckCount != -1) { instStats.put("service_check_count", serviceCheckCount); } + if (instanceTelemetryBean != null){ + Map instanceTelemetryBeanStats = new HashMap(); + instanceTelemetryBeanStats.put("name", instanceTelemetryBeanName.toString()); + instanceTelemetryBeanStats.put("beans_fetched_count", instanceTelemetryBean.getBeansFetched()); + instanceTelemetryBeanStats.put("bean_attribute_count", instanceTelemetryBean.getTopLevelAttributeCount()); + instanceTelemetryBeanStats.put("bean_metric_count", instanceTelemetryBean.getMetricCount()); + instStats.put("instanceTelemetryBean", instanceTelemetryBeanStats); + } instStats.put("message", message); instStats.put("status", status); checkStats.add(instStats); @@ -125,7 +143,7 @@ private void addStats( } public void addInitFailedCheck(String checkName, String message, String status) { - addStats(checkName, null, -1, -1, message, status, FAILED_CHECKS); + addStats(checkName, null, -1, -1, message, status, FAILED_CHECKS, null, null); } private String generateYaml() { From f5cd62a7e417fb414dc9018512570aac0e772702 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Thu, 31 Aug 2023 13:41:44 -0400 Subject: [PATCH 02/10] edit stats display --- src/main/java/org/datadog/jmxfetch/App.java | 2 +- .../java/org/datadog/jmxfetch/Instance.java | 4 ---- .../java/org/datadog/jmxfetch/Status.java | 20 +++++++------------ 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/datadog/jmxfetch/App.java b/src/main/java/org/datadog/jmxfetch/App.java index 5bb6f9499..cec8319a2 100644 --- a/src/main/java/org/datadog/jmxfetch/App.java +++ b/src/main/java/org/datadog/jmxfetch/App.java @@ -756,7 +756,7 @@ private void reportStatus( stats.addInstanceStats( checkName, instance.getName(), metricCount, reporter.getServiceCheckCount(checkName), - message, status, instance.getInstanceTelemetryBean(), instance.getInstanceTelemetryBeanName()); + message, status, instance.getInstanceTelemetryBean()); if (reporter.getHandler() != null) { stats.addErrorStats(reporter.getHandler().getErrors()); } diff --git a/src/main/java/org/datadog/jmxfetch/Instance.java b/src/main/java/org/datadog/jmxfetch/Instance.java index a4aed236b..a2c5cbce4 100644 --- a/src/main/java/org/datadog/jmxfetch/Instance.java +++ b/src/main/java/org/datadog/jmxfetch/Instance.java @@ -831,10 +831,6 @@ public InstanceTelemetry getInstanceTelemetryBean() { return this.instanceTelemetryBean; } - public ObjectName getInstanceTelemetryBeanName() { - return this.instanceTelemetryBeanName; - } - /** Returns whether or not the instance has reached the maximum bean collection limit. */ public boolean isLimitReached() { return this.limitReached; diff --git a/src/main/java/org/datadog/jmxfetch/Status.java b/src/main/java/org/datadog/jmxfetch/Status.java index 1c35c979c..613ac7d78 100644 --- a/src/main/java/org/datadog/jmxfetch/Status.java +++ b/src/main/java/org/datadog/jmxfetch/Status.java @@ -78,8 +78,7 @@ public void addInstanceStats( int serviceCheckCount, String message, String status, - InstanceTelemetry instanceTelemetryBean, - ObjectName instanceTelemetryBeanName) { + InstanceTelemetry instanceTelemetryBean) { addStats( checkName, instance, @@ -88,8 +87,7 @@ public void addInstanceStats( message, status, INITIALIZED_CHECKS, - instanceTelemetryBean, - instanceTelemetryBeanName); + instanceTelemetryBean); } public void addErrorStats(int errors) { @@ -105,8 +103,7 @@ private void addStats( String message, String status, String key, - InstanceTelemetry instanceTelemetryBean, - ObjectName instanceTelemetryBeanName) { + InstanceTelemetry instanceTelemetryBean) { List> checkStats; Map initializedChecks; initializedChecks = (Map) this.instanceStats.get(key); @@ -128,12 +125,9 @@ private void addStats( instStats.put("service_check_count", serviceCheckCount); } if (instanceTelemetryBean != null){ - Map instanceTelemetryBeanStats = new HashMap(); - instanceTelemetryBeanStats.put("name", instanceTelemetryBeanName.toString()); - instanceTelemetryBeanStats.put("beans_fetched_count", instanceTelemetryBean.getBeansFetched()); - instanceTelemetryBeanStats.put("bean_attribute_count", instanceTelemetryBean.getTopLevelAttributeCount()); - instanceTelemetryBeanStats.put("bean_metric_count", instanceTelemetryBean.getMetricCount()); - instStats.put("instanceTelemetryBean", instanceTelemetryBeanStats); + instStats.put("bean_count", instanceTelemetryBean.getBeansFetched()); + instStats.put("attribute_count", instanceTelemetryBean.getTopLevelAttributeCount()); + instStats.put("bean_metric_count", instanceTelemetryBean.getMetricCount()); } instStats.put("message", message); instStats.put("status", status); @@ -143,7 +137,7 @@ private void addStats( } public void addInitFailedCheck(String checkName, String message, String status) { - addStats(checkName, null, -1, -1, message, status, FAILED_CHECKS, null, null); + addStats(checkName, null, -1, -1, message, status, FAILED_CHECKS, null); } private String generateYaml() { From 3f875cee30bcd34ecebcb63bf1b7ceb76c57d996 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Fri, 1 Sep 2023 10:48:57 -0400 Subject: [PATCH 03/10] java lint --- src/main/java/org/datadog/jmxfetch/App.java | 1 - src/main/java/org/datadog/jmxfetch/Status.java | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/datadog/jmxfetch/App.java b/src/main/java/org/datadog/jmxfetch/App.java index cec8319a2..00ab71d4b 100644 --- a/src/main/java/org/datadog/jmxfetch/App.java +++ b/src/main/java/org/datadog/jmxfetch/App.java @@ -13,7 +13,6 @@ import org.datadog.jmxfetch.util.ByteArraySearcher; import org.datadog.jmxfetch.util.CustomLogger; import org.datadog.jmxfetch.util.FileHelper; -import org.datadog.jmxfetch.util.InstanceTelemetry; import org.datadog.jmxfetch.util.LogLevel; import org.datadog.jmxfetch.util.MetadataHelper; import org.datadog.jmxfetch.util.ServiceCheckHelper; diff --git a/src/main/java/org/datadog/jmxfetch/Status.java b/src/main/java/org/datadog/jmxfetch/Status.java index 613ac7d78..1358b6004 100644 --- a/src/main/java/org/datadog/jmxfetch/Status.java +++ b/src/main/java/org/datadog/jmxfetch/Status.java @@ -17,8 +17,6 @@ import java.util.List; import java.util.Map; -import javax.management.ObjectName; - @Slf4j public class Status { @@ -124,10 +122,11 @@ private void addStats( if (serviceCheckCount != -1) { instStats.put("service_check_count", serviceCheckCount); } - if (instanceTelemetryBean != null){ - instStats.put("bean_count", instanceTelemetryBean.getBeansFetched()); - instStats.put("attribute_count", instanceTelemetryBean.getTopLevelAttributeCount()); - instStats.put("bean_metric_count", instanceTelemetryBean.getMetricCount()); + if (instanceTelemetryBean != null) { + instStats.put("instance_bean_count", instanceTelemetryBean.getBeansFetched()); + instStats.put("instance_attribute_count", + instanceTelemetryBean.getTopLevelAttributeCount()); + instStats.put("instance_metric_count", instanceTelemetryBean.getMetricCount()); } instStats.put("message", message); instStats.put("status", status); From 21427bfbf0cbef3aef924cfac5133e695ec5f5a0 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Fri, 1 Sep 2023 11:21:17 -0400 Subject: [PATCH 04/10] bump pom.xml for 0.48.1 snapshot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3c7e12cf..01b5f929a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.datadoghq jmxfetch - 0.48.0-SNAPSHOT + 0.48.1-SNAPSHOT jar jmxfetch From 3d0d3f7b06e7e3a129b35397dfef0bb3264b1832 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Fri, 1 Sep 2023 12:49:40 -0400 Subject: [PATCH 05/10] Revert "bump pom.xml for 0.48.1 snapshot" This reverts commit 21427bfbf0cbef3aef924cfac5133e695ec5f5a0. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 01b5f929a..e3c7e12cf 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.datadoghq jmxfetch - 0.48.1-SNAPSHOT + 0.48.0-SNAPSHOT jar jmxfetch From 344d79baa781cc6dcd4dfe3de763c0dc92e85e10 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Tue, 5 Sep 2023 01:57:13 -0400 Subject: [PATCH 06/10] attempt status test --- .../java/org/datadog/jmxfetch/TestCommon.java | 1 + .../java/org/datadog/jmxfetch/TestStatus.java | 26 +++++++++++++++++++ .../jmx_status_check_instance_telemetry.yaml | 21 +++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 src/test/java/org/datadog/jmxfetch/TestStatus.java create mode 100644 src/test/resources/jmx_status_check_instance_telemetry.yaml diff --git a/src/test/java/org/datadog/jmxfetch/TestCommon.java b/src/test/java/org/datadog/jmxfetch/TestCommon.java index e5cadcfac..83eb6ceaf 100644 --- a/src/test/java/org/datadog/jmxfetch/TestCommon.java +++ b/src/test/java/org/datadog/jmxfetch/TestCommon.java @@ -139,6 +139,7 @@ protected void initApplication(String yamlFileName, String autoDiscoveryPipeFile params.add(5, "/foo"); // could be anything we're stubbing it out params.add(6, "--sd_enabled"); } + params.add("--jmxfetch_telemetry"); new JCommander(appConfig, params.toArray(new String[params.size()])); if (sdEnabled) { diff --git a/src/test/java/org/datadog/jmxfetch/TestStatus.java b/src/test/java/org/datadog/jmxfetch/TestStatus.java new file mode 100644 index 000000000..5092ebd6e --- /dev/null +++ b/src/test/java/org/datadog/jmxfetch/TestStatus.java @@ -0,0 +1,26 @@ +package org.datadog.jmxfetch; + +import static org.junit.Assert.assertEquals; + +import java.util.List; +import java.util.Map; + +import org.datadog.jmxfetch.util.InstanceTelemetryMBean; +import org.junit.Test; + +public class TestStatus extends TestCommon { + + @Test + public void testStatusInstanceTelemetry() throws Exception { + registerMBean(new SimpleTestJavaApp(), "org.datadog.jmxfetch.test:type=SimpleTestJavaApp"); + initApplication("jmx_status_check_instance_telemetry.yaml"); + List instances = getInstances(); + assertEquals(1, instances.size()); + Instance inst = instances.get(0); + List metrics = inst.getMetrics(); + InstanceTelemetryMBean instanceTelemetryBean = inst.getInstanceTelemetryBean(); + assertEquals(17, instanceTelemetryBean.getBeansFetched()); + assertEquals(10, instanceTelemetryBean.getTopLevelAttributeCount()); + assertEquals(16, instanceTelemetryBean.getMetricCount()); + } +} diff --git a/src/test/resources/jmx_status_check_instance_telemetry.yaml b/src/test/resources/jmx_status_check_instance_telemetry.yaml new file mode 100644 index 000000000..f646b669b --- /dev/null +++ b/src/test/resources/jmx_status_check_instance_telemetry.yaml @@ -0,0 +1,21 @@ +init_config: + +instances: + - process_name_regex: .*surefire.* + name: jmx_test_instance + tags: + env: stage + newTag: test + conf: + - include: + domain: org.datadog.jmxfetch.test + attribute: + ShouldBe100: + metric_type: gauge + alias: this.is.100.$foo.$qux + Hashmap.thisis0: + metric_type: gauge + alias: $attribute + Int424242: + metric_type: histogram + alias: test1.histogram From 8c401aea414b95564422bcd1361f908e5e74a3c7 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Tue, 5 Sep 2023 12:44:38 -0400 Subject: [PATCH 07/10] update status test --- .../java/org/datadog/jmxfetch/Status.java | 3 + .../java/org/datadog/jmxfetch/StatusTest.java | 66 +++++++++++++++++++ .../java/org/datadog/jmxfetch/TestCommon.java | 1 - .../java/org/datadog/jmxfetch/TestStatus.java | 26 -------- .../jmx_status_check_instance_telemetry.yaml | 21 ------ 5 files changed, 69 insertions(+), 48 deletions(-) create mode 100644 src/test/java/org/datadog/jmxfetch/StatusTest.java delete mode 100644 src/test/java/org/datadog/jmxfetch/TestStatus.java delete mode 100644 src/test/resources/jmx_status_check_instance_telemetry.yaml diff --git a/src/main/java/org/datadog/jmxfetch/Status.java b/src/main/java/org/datadog/jmxfetch/Status.java index 1358b6004..e6ecfc494 100644 --- a/src/main/java/org/datadog/jmxfetch/Status.java +++ b/src/main/java/org/datadog/jmxfetch/Status.java @@ -130,6 +130,9 @@ private void addStats( } instStats.put("message", message); instStats.put("status", status); + // NOTE: jmxfetch template must be updated for any new keys in order for them + // to show up in the datadog-agent status + // https://github.com/DataDog/datadog-agent/blob/main/pkg/status/templates/jmxfetch.tmpl checkStats.add(instStats); initializedChecks.put(checkName, checkStats); this.instanceStats.put(key, initializedChecks); diff --git a/src/test/java/org/datadog/jmxfetch/StatusTest.java b/src/test/java/org/datadog/jmxfetch/StatusTest.java new file mode 100644 index 000000000..fc239ae28 --- /dev/null +++ b/src/test/java/org/datadog/jmxfetch/StatusTest.java @@ -0,0 +1,66 @@ +package org.datadog.jmxfetch; + +import static org.junit.Assert.*; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.datadog.jmxfetch.util.InstanceTelemetry; +import org.datadog.jmxfetch.util.InstanceTelemetryMBean; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.yaml.snakeyaml.Yaml; + +public class StatusTest { + + @Rule + public TemporaryFolder folder= new TemporaryFolder(); + + @Test + public void TestStatus() throws IOException { + + File tempFile= folder.newFile("tempFile.txt"); + String tempFilePath = tempFile.getAbsolutePath(); + + final Status status = new Status(tempFilePath); + InstanceTelemetry instance = new InstanceTelemetry(); + + int fakeBeansFetched = 11; + int fakeMetricCount = 29; + int fakeAttributeCount = 55; + + instance.setBeansFetched(fakeBeansFetched); + instance.setMetricCount(fakeMetricCount); + instance.setTopLevelAttributeCount(fakeAttributeCount); + + status.addInstanceStats("fake_check", "fake_instance", 10, 3, "fake_message", Status.STATUS_OK, instance); + status.flush(); + + Yaml yaml = new Yaml(); + InputStream inputStream = new FileInputStream(tempFilePath); + + HashMap yamlMap = yaml.load(inputStream); + HashMap checks = (HashMap) yamlMap.get("checks"); + HashMap initializedChecks = (HashMap) checks.get("initialized_checks"); + List> fakeCheck = (List>) initializedChecks.get("fake_check"); + Map stats = fakeCheck.get(0); + assertEquals("fake_instance", stats.get("instance_name")); + assertEquals(10, stats.get("metric_count")); + assertEquals(3, stats.get("service_check_count")); + assertEquals(fakeBeansFetched, stats.get("instance_bean_count")); + assertEquals(fakeAttributeCount, stats.get("instance_attribute_count")); + assertEquals(fakeMetricCount, stats.get("instance_metric_count")); + assertEquals("fake_message", stats.get("message")); + assertEquals(Status.STATUS_OK, stats.get("status")); + } +} \ No newline at end of file diff --git a/src/test/java/org/datadog/jmxfetch/TestCommon.java b/src/test/java/org/datadog/jmxfetch/TestCommon.java index 83eb6ceaf..e5cadcfac 100644 --- a/src/test/java/org/datadog/jmxfetch/TestCommon.java +++ b/src/test/java/org/datadog/jmxfetch/TestCommon.java @@ -139,7 +139,6 @@ protected void initApplication(String yamlFileName, String autoDiscoveryPipeFile params.add(5, "/foo"); // could be anything we're stubbing it out params.add(6, "--sd_enabled"); } - params.add("--jmxfetch_telemetry"); new JCommander(appConfig, params.toArray(new String[params.size()])); if (sdEnabled) { diff --git a/src/test/java/org/datadog/jmxfetch/TestStatus.java b/src/test/java/org/datadog/jmxfetch/TestStatus.java deleted file mode 100644 index 5092ebd6e..000000000 --- a/src/test/java/org/datadog/jmxfetch/TestStatus.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.datadog.jmxfetch; - -import static org.junit.Assert.assertEquals; - -import java.util.List; -import java.util.Map; - -import org.datadog.jmxfetch.util.InstanceTelemetryMBean; -import org.junit.Test; - -public class TestStatus extends TestCommon { - - @Test - public void testStatusInstanceTelemetry() throws Exception { - registerMBean(new SimpleTestJavaApp(), "org.datadog.jmxfetch.test:type=SimpleTestJavaApp"); - initApplication("jmx_status_check_instance_telemetry.yaml"); - List instances = getInstances(); - assertEquals(1, instances.size()); - Instance inst = instances.get(0); - List metrics = inst.getMetrics(); - InstanceTelemetryMBean instanceTelemetryBean = inst.getInstanceTelemetryBean(); - assertEquals(17, instanceTelemetryBean.getBeansFetched()); - assertEquals(10, instanceTelemetryBean.getTopLevelAttributeCount()); - assertEquals(16, instanceTelemetryBean.getMetricCount()); - } -} diff --git a/src/test/resources/jmx_status_check_instance_telemetry.yaml b/src/test/resources/jmx_status_check_instance_telemetry.yaml deleted file mode 100644 index f646b669b..000000000 --- a/src/test/resources/jmx_status_check_instance_telemetry.yaml +++ /dev/null @@ -1,21 +0,0 @@ -init_config: - -instances: - - process_name_regex: .*surefire.* - name: jmx_test_instance - tags: - env: stage - newTag: test - conf: - - include: - domain: org.datadog.jmxfetch.test - attribute: - ShouldBe100: - metric_type: gauge - alias: this.is.100.$foo.$qux - Hashmap.thisis0: - metric_type: gauge - alias: $attribute - Int424242: - metric_type: histogram - alias: test1.histogram From 71754b217cb023271d3798dcd39f0f0c55cc1d84 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Tue, 5 Sep 2023 12:59:22 -0400 Subject: [PATCH 08/10] remove unnecessary imports --- src/test/java/org/datadog/jmxfetch/StatusTest.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/test/java/org/datadog/jmxfetch/StatusTest.java b/src/test/java/org/datadog/jmxfetch/StatusTest.java index fc239ae28..471aac120 100644 --- a/src/test/java/org/datadog/jmxfetch/StatusTest.java +++ b/src/test/java/org/datadog/jmxfetch/StatusTest.java @@ -2,20 +2,15 @@ import static org.junit.Assert.*; -import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; -import java.io.FileReader; import java.io.IOException; import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; import java.util.HashMap; import java.util.List; import java.util.Map; import org.datadog.jmxfetch.util.InstanceTelemetry; -import org.datadog.jmxfetch.util.InstanceTelemetryMBean; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; From 808bbe16eab77ff41290481dd1ddfb053b8b1210 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Wed, 6 Sep 2023 10:50:54 -0400 Subject: [PATCH 09/10] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0fcb92de..d6b37054e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog * [FEATURE] Adds a configurable jmxfetch telemetry check to improve jmxfetch observability [#467][] * [FEATURE] Added an option to enable removal of extra quotation marks during tag extraction from Java management beans' parameters/attributes [#469][] +* [FEATURE] Updated status bean to report JMX Telemetry to Agent status [#477][] # 0.47.10 / 2023-08-10 From 81cf78fe3210c067cff254b15cacc9b7a7638161 Mon Sep 17 00:00:00 2001 From: raymond zhao Date: Wed, 6 Sep 2023 13:10:07 -0400 Subject: [PATCH 10/10] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b37054e..9c7889205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -754,6 +754,7 @@ Changelog [#457]: https://github.com/DataDog/jmxfetch/issues/457 [#449]: https://github.com/DataDog/jmxfetch/issues/449 [#469]: https://github.com/DataDog/jmxfetch/issues/469 +[#477]: https://github.com/DataDog/jmxfetch/issues/477 [@alz]: https://github.com/alz [@aoking]: https://github.com/aoking [@arrawatia]: https://github.com/arrawatia