Skip to content

Commit

Permalink
Added config to not collect default JVM metrics (#345)
Browse files Browse the repository at this point in the history
* added flag to not collect default JVM metrics

* cleanup log line
  • Loading branch information
gh123man authored Dec 11, 2020
1 parent 355a95c commit f4237db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/datadog/jmxfetch/Instance.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,13 @@ public Instance(
}
}

loadDefaultConfig("default-jmx-metrics.yaml");
loadDefaultConfig(gcMetricConfig);
Boolean collectDefaultJvmMetrics = (Boolean) instanceMap.get("collect_default_jvm_metrics");
if (collectDefaultJvmMetrics == null || collectDefaultJvmMetrics) {
loadDefaultConfig("default-jmx-metrics.yaml");
loadDefaultConfig(gcMetricConfig);
} else {
log.info("collect_default_jvm_metrics is false - not collecting default JVM metrics");
}
}

public static boolean isDirectInstance(Map<String, Object> configInstance) {
Expand Down

0 comments on commit f4237db

Please sign in to comment.