From 2cf001a0dc63fa316ec1a23a8ce3f0ce7b2ffb98 Mon Sep 17 00:00:00 2001 From: Caleb Metz <135133572+cmetz100@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:59:11 -0400 Subject: [PATCH] Update jmxfetch telemetry to jvm_direct (#475) * update instance toString * changed jmxfetch telemetry to jvm direct --- src/main/java/org/datadog/jmxfetch/App.java | 2 +- src/main/java/org/datadog/jmxfetch/Instance.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/datadog/jmxfetch/App.java b/src/main/java/org/datadog/jmxfetch/App.java index 00ab71d4b..ddb6f1de8 100644 --- a/src/main/java/org/datadog/jmxfetch/App.java +++ b/src/main/java/org/datadog/jmxfetch/App.java @@ -968,7 +968,7 @@ private Map getTelemetryInstanceConfig() { config.put("name","jmxfetch_telemetry_instance"); config.put("collect_default_jvm_metrics",true); config.put("new_gc_metrics",true); - config.put("process_name_regex",".*org.datadog.jmxfetch.App.*"); + config.put("jvm_direct",true); config.put("normalize_bean_param_tags",true); List conf = new ArrayList(); diff --git a/src/main/java/org/datadog/jmxfetch/Instance.java b/src/main/java/org/datadog/jmxfetch/Instance.java index a2c5cbce4..770a8f863 100644 --- a/src/main/java/org/datadog/jmxfetch/Instance.java +++ b/src/main/java/org/datadog/jmxfetch/Instance.java @@ -479,7 +479,11 @@ public void init(boolean forceNewConnection) @Override public String toString() { if (isDirectInstance(instanceMap)) { - return "jvm_direct"; + if (this.instanceMap.get("name") != null) { + return "jvm_direct - name: `" + (String) this.instanceMap.get("name") + "`"; + } else { + return "jvm_direct"; + } } else if (this.instanceMap.get(PROCESS_NAME_REGEX) != null) { return "process_regex: `" + this.instanceMap.get(PROCESS_NAME_REGEX) + "`"; } else if (this.instanceMap.get("name") != null) {