Skip to content

Commit af1f3d3

Browse files
authored
Update to client_java 0.10.0 and OpenMetrics. (#575)
Transparently handle the UNTYPED->UNKNOWN switch for users. Change snakeyaml version to 1.23 so Java 6 works again, fixes #537. Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
1 parent 3be3a59 commit af1f3d3

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

collector/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<dependency>
1919
<groupId>io.prometheus</groupId>
2020
<artifactId>simpleclient</artifactId>
21-
<version>0.9.0</version>
21+
<version>0.10.0</version>
2222
</dependency>
2323
<dependency>
2424
<groupId>junit</groupId>
@@ -29,7 +29,7 @@
2929
<dependency>
3030
<groupId>org.yaml</groupId>
3131
<artifactId>snakeyaml</artifactId>
32-
<version>1.26</version>
32+
<version>1.23</version>
3333
</dependency>
3434
</dependencies>
3535

collector/src/main/java/io/prometheus/jmx/JmxCollector.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static class Rule {
4646
String help;
4747
boolean attrNameSnakeCase;
4848
boolean cache = false;
49-
Type type = Type.UNTYPED;
49+
Type type = Type.UNKNOWN;
5050
ArrayList<String> labelNames;
5151
ArrayList<String> labelValues;
5252
}
@@ -210,7 +210,12 @@ private Config loadConfig(Map<String, Object> yamlConfig) throws MalformedObject
210210
rule.cache = (Boolean)yamlRule.get("cache");
211211
}
212212
if (yamlRule.containsKey("type")) {
213-
rule.type = Type.valueOf((String)yamlRule.get("type"));
213+
String t = (String)yamlRule.get("type");
214+
// Gracefully handle switch to OM data model.
215+
if ("UNTYPED".equals(t)) {
216+
t = "UNKNOWN";
217+
}
218+
rule.type = Type.valueOf(t);
214219
}
215220
if (yamlRule.containsKey("help")) {
216221
rule.help = (String)yamlRule.get("help");

jmx_prometheus_httpserver/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<dependency>
2323
<groupId>io.prometheus</groupId>
2424
<artifactId>simpleclient_httpserver</artifactId>
25-
<version>0.9.0</version>
25+
<version>0.10.0</version>
2626
</dependency>
2727
</dependencies>
2828

jmx_prometheus_javaagent/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
<dependency>
2424
<groupId>io.prometheus</groupId>
2525
<artifactId>simpleclient_hotspot</artifactId>
26-
<version>0.9.0</version>
26+
<version>0.10.0</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>io.prometheus</groupId>
3030
<artifactId>simpleclient_httpserver</artifactId>
31-
<version>0.9.0</version>
31+
<version>0.10.0</version>
3232
</dependency>
3333
<dependency>
3434
<groupId>junit</groupId>

0 commit comments

Comments
 (0)