Skip to content

Commit

Permalink
Fixed JSON payload in telemetry reporting (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
andsel authored Dec 29, 2022
1 parent d1b9a49 commit bb3880c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions broker/src/main/java/io/moquette/broker/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,19 @@ private String collectTelemetryData(String uuid) {
final String maxHeap = maxMemory == Long.MAX_VALUE ? "undefined" : Long.toString(maxMemory);

return String.format(
"{\"os\": %s, " +
"\"cpu_arch\": %s, " +
"\"jvm_version\": %s, " +
"\"jvm_vendor\": %s, " +
"\"broker_version\": %s, " +
"{\"os\": \"%s\", " +
"\"cpu_arch\": \"%s\", " +
"\"jvm_version\": \"%s\", " +
"\"jvm_vendor\": \"%s\", " +
"\"broker_version\": \"%s\", " +
"\"standalone\": %s," +
"\"max_heap\": %s" +
"\"uuid\": %s}",
"\"max_heap\": \"%s\", " +
"\"uuid\": \"%s\"}",
os, cpuArch, jvmVersion, jvmVendor, MOQUETTE_VERSION, this.standalone, maxHeap, uuid);
}

private void sendTelemetryData(String telemetryDoc) throws IOException {
URL url = new URL("http://telemetry.moquette.io/api/v1/notify");
URL url = new URL("https://telemetry.moquette.io/api/v1/notify");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
Expand Down

0 comments on commit bb3880c

Please sign in to comment.