Skip to content

Commit

Permalink
Allow the troubleshooting commands to use the https endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
arbll committed Apr 16, 2018
1 parent bc8ed21 commit 1e163cf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ mvn test
# To run:
```
Get help on usage:
java -jar jmxfetch-0.19.0-jar-with-dependencies.jar --help
java -jar jmxfetch-0.20.0-jar-with-dependencies.jar --help
```
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>datadog</groupId>
<artifactId>jmxfetch</artifactId>
<version>0.19.0</version>
<version>0.20.0</version>
<packaging>jar</packaging>

<name>jmxfetch</name>
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/org/datadog/jmxfetch/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -624,8 +629,6 @@ public void init(boolean forceNewConnection) {
clearInstances(instances);
clearInstances(brokenInstances);

Reporter reporter = appConfig.getReporter();

Iterator<Entry<String, YamlParser>> it = configs.entrySet().iterator();
Iterator<Entry<String, YamlParser>> itSD = adPipeConfigs.entrySet().iterator();
while (it.hasNext() || itSD.hasNext()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/datadog/jmxfetch/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 1e163cf

Please sign in to comment.