Skip to content

Commit

Permalink
Update jmxfetch telemetry to jvm_direct (#475)
Browse files Browse the repository at this point in the history
* update instance toString

* changed jmxfetch telemetry to jvm direct
  • Loading branch information
cmetz100 authored Sep 15, 2023
1 parent d002d62 commit 2cf001a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/datadog/jmxfetch/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ private Map<String,Object> 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<Object> conf = new ArrayList<Object>();
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/datadog/jmxfetch/Instance.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2cf001a

Please sign in to comment.