diff --git a/CHANGELOG.md b/CHANGELOG.md index ad332f191..eda8ecd3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changes ======= +# 0.20.0 / Unreleased + +### Changes + +* [FEATURE] Configs can now be given to jmxfetch using the https endpoint when running list_* troubleshooting commands. See [#171][]. + # 0.19.0 / 03/19/2018 ### Changes diff --git a/src/main/java/org/datadog/jmxfetch/App.java b/src/main/java/org/datadog/jmxfetch/App.java index 8635d51a6..27bc59376 100644 --- a/src/main/java/org/datadog/jmxfetch/App.java +++ b/src/main/java/org/datadog/jmxfetch/App.java @@ -136,6 +136,11 @@ public static void main(String[] args) { App app = new App(config); + // Get config from the ipc endpoint for "list_*" actions + if (!config.getAction().equals(AppConfig.ACTION_COLLECT)) { + app.getJSONConfigs(); + } + // Initiate JMX Connections, get attributes that match the yaml configuration app.init(false); @@ -624,8 +629,6 @@ public void init(boolean forceNewConnection) { clearInstances(instances); clearInstances(brokenInstances); - Reporter reporter = appConfig.getReporter(); - Iterator> it = configs.entrySet().iterator(); Iterator> itSD = adPipeConfigs.entrySet().iterator(); while (it.hasNext() || itSD.hasNext()) { diff --git a/src/main/java/org/datadog/jmxfetch/HttpClient.java b/src/main/java/org/datadog/jmxfetch/HttpClient.java index 9cc99d778..098e073ac 100644 --- a/src/main/java/org/datadog/jmxfetch/HttpClient.java +++ b/src/main/java/org/datadog/jmxfetch/HttpClient.java @@ -107,7 +107,7 @@ public HttpResponse request(String method, String body, String path) { con.setRequestMethod(method.toUpperCase()); con.setRequestProperty("Authorization", "Bearer "+ this.token); con.setRequestProperty("User-Agent", USER_AGENT); - if (method.toUpperCase() == "GET") { + if (method.toUpperCase().equals("GET")) { con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); } else { con.setRequestProperty("Content-Type", "application/json");