Skip to content

Commit 39d1e36

Browse files
authored
client_java 1.3.0 integration (#957)
Signed-off-by: dhoard <[email protected]>
1 parent d8cc3e5 commit 39d1e36

File tree

13 files changed

+48
-25
lines changed

13 files changed

+48
-25
lines changed

MAINTAINER_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Checkout the `main` branch and increment the version
8888

8989
```shell
9090
git checkout main
91-
./tools/change-version.sh 1.0.0-SNAPSHOT
91+
./tools/change-version.sh 1.0.0
9292
git add -u
9393
git commit -m "prepare for next development iteration"
9494
```

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ process metrics (e.g., memory and CPU usage).
1717

1818
**Documentation is specific to a release.**
1919

20+
[1.0.0](https://github.com/prometheus/jmx_exporter/tree/release-1.0.0)
21+
2022
[0.20.0](https://github.com/prometheus/jmx_exporter/tree/release-0.20.0)
2123

2224
[0.19.0](https://github.com/prometheus/jmx_exporter/tree/release-0.19.0)

collector/pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.prometheus.jmx</groupId>
77
<artifactId>parent</artifactId>
8-
<version>1.0.0-SNAPSHOT</version>
8+
<version>1.0.0</version>
99
</parent>
1010

1111
<artifactId>collector</artifactId>
@@ -55,15 +55,17 @@
5555
<dependency>
5656
<groupId>io.prometheus</groupId>
5757
<artifactId>prometheus-metrics-core</artifactId>
58+
<version>1.3.0</version>
5859
</dependency>
5960
<dependency>
6061
<groupId>io.prometheus</groupId>
6162
<artifactId>prometheus-metrics-model</artifactId>
63+
<version>1.3.0</version>
6264
</dependency>
6365
<dependency>
6466
<groupId>io.prometheus</groupId>
6567
<artifactId>prometheus-metrics-exposition-formats</artifactId>
66-
<version>1.2.0</version>
68+
<version>1.3.0</version>
6769
</dependency>
6870
<dependency>
6971
<groupId>org.yaml</groupId>

collector/src/test/java/io/prometheus/jmx/DuplicateLabels.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,29 @@
1616

1717
package io.prometheus.jmx;
1818

19+
import static org.junit.Assert.assertEquals;
20+
import static org.junit.Assert.assertThrows;
21+
22+
import io.prometheus.metrics.model.snapshots.DuplicateLabelsException;
23+
import io.prometheus.metrics.model.snapshots.Labels;
24+
import io.prometheus.metrics.model.snapshots.MetricSnapshots;
1925
import io.prometheus.metrics.model.snapshots.UnknownSnapshot;
2026
import java.util.HashMap;
2127
import java.util.Map;
28+
import org.junit.Before;
29+
import org.junit.Test;
2230

2331
public class DuplicateLabels {
2432

2533
Map<String, UnknownSnapshot.Builder> unknownMap;
2634

27-
// @Before
35+
@Before
2836
public void setUp() {
2937
unknownMap = new HashMap<>();
3038
}
3139

32-
// @Test
40+
@Test
3341
public void testDuplicateLabels() {
34-
/*
3542
UnknownSnapshot.Builder unknownBuilder =
3643
unknownMap.computeIfAbsent(
3744
"test",
@@ -77,6 +84,5 @@ public void testDuplicateLabels() {
7784
assertEquals(
7885
"Duplicate labels for metric \"test_metric\": {label1=\"value1\"}",
7986
exception.getMessage());
80-
*/
8187
}
8288
}

docs/README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
JMX Exporter
66
=====
77

8-
98
JMX to Prometheus exporter: a collector that can configurable scrape and
109
expose mBeans of a JMX target.
1110

@@ -15,16 +14,25 @@ HTTP server and scrape remote JMX targets, but this has various
1514
disadvantages, such as being harder to configure and being unable to expose
1615
process metrics (e.g., memory and CPU usage).
1716

18-
**Running the exporter as a Java agent is strongly encouraged.**
17+
### **NOTE**
18+
19+
**Some JVM metric names have changed to conform with the [OpenMetrics](https://openmetrics.io/) specification.**
20+
21+
**Dashboards will need to be changed if referencing the changed JVM metrics.**
22+
23+
https://prometheus.github.io/client_java/migration/simpleclient/#jvm-metrics
24+
1925

2026
## Running the Java Agent
2127

22-
- [jmx_prometheus_javaagent-0.20.0.jar](https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.20.0/jmx_prometheus_javaagent-0.20.0.jar)
28+
**Running the exporter as a Java agent is strongly encouraged.**
29+
30+
- [jmx_prometheus_javaagent-1.0.0.jar](https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/1.0.0/jmx_prometheus_javaagent-1.0.0.jar)
2331

2432
To run as a Java agent, download one of the JARs and run:
2533

2634
```
27-
java -javaagent:./jmx_prometheus_javaagent-0.20.0.jar=12345:config.yaml -jar yourJar.jar
35+
java -javaagent:./jmx_prometheus_javaagent-1.0.0.jar=12345:config.yaml -jar yourJar.jar
2836
```
2937

3038
Metrics will now be accessible at [http://localhost:12345/metrics](http://localhost:12345/metrics).
@@ -41,12 +49,12 @@ Example configurations can be found in the `example_configs/` directory.
4149

4250
## Running the Standalone HTTP Server
4351

44-
- [jmx_prometheus_httpserver-0.20.0.jar](https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_httpserver/0.20.0/jmx_prometheus_httpserver-0.20.0.jar)
52+
- [jmx_prometheus_httpserver-1.0.0.jar](https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_httpserver/1.0.0/jmx_prometheus_httpserver-1.0.0.jar)
4553

4654
To run the standalone HTTP server, download one of the JARs and run:
4755

4856
```
49-
java -jar jmx_prometheus_httpserver-0.20.0.jar 12345 config.yaml
57+
java -jar jmx_prometheus_httpserver-1.0.0.jar 12345 config.yaml
5058
```
5159

5260
Metrics will now be accessible at [http://localhost:12345/metrics](http://localhost:12345/metrics).

integration_test_suite/integration_tests/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.prometheus.jmx</groupId>
77
<artifactId>integration_test_suite</artifactId>
8-
<version>1.0.0-SNAPSHOT</version>
8+
<version>1.0.0</version>
99
</parent>
1010

1111
<artifactId>integration_tests</artifactId>
@@ -105,10 +105,15 @@
105105
<artifactId>test-engine-api</artifactId>
106106
<version>${antublue.test.engine.version}</version>
107107
</dependency>
108+
<dependency>
109+
<groupId>io.prometheus</groupId>
110+
<artifactId>prometheus-metrics-model</artifactId>
111+
<version>1.3.0</version>
112+
</dependency>
108113
<dependency>
109114
<groupId>io.prometheus</groupId>
110115
<artifactId>prometheus-metrics-exposition-formats</artifactId>
111-
<version>1.2.0</version>
116+
<version>1.3.0</version>
112117
</dependency>
113118
<dependency>
114119
<groupId>org.slf4j</groupId>

integration_test_suite/integration_tests/src/main/java/io/prometheus/jmx/test/support/TestContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.testcontainers.containers.GenericContainer;
2121
import org.testcontainers.containers.Network;
2222

23-
/** Class to a TestState */
23+
/** Class to a TestContext */
2424
public class TestContext {
2525

2626
private Network network;

integration_test_suite/jmx_example_application/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.prometheus.jmx</groupId>
77
<artifactId>integration_test_suite</artifactId>
8-
<version>1.0.0-SNAPSHOT</version>
8+
<version>1.0.0</version>
99
</parent>
1010

1111
<artifactId>jmx_example_application</artifactId>
@@ -33,13 +33,13 @@
3333
<dependency>
3434
<groupId>io.prometheus</groupId>
3535
<artifactId>prometheus-metrics-core</artifactId>
36-
<version>1.2.0</version>
36+
<version>1.3.0</version>
3737
<scope>compile</scope>
3838
</dependency>
3939
<dependency>
4040
<groupId>io.prometheus</groupId>
4141
<artifactId>prometheus-metrics-exposition-formats</artifactId>
42-
<version>1.2.0</version>
42+
<version>1.3.0</version>
4343
<scope>compile</scope>
4444
</dependency>
4545
</dependencies>

integration_test_suite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>io.prometheus.jmx</groupId>
55
<artifactId>integration_test_suite</artifactId>
6-
<version>1.0.0-SNAPSHOT</version>
6+
<version>1.0.0</version>
77
<name>Prometheus JMX Exporter - Integration Test Suite</name>
88
<description>
99
See https://github.com/prometheus/jmx_exporter/blob/master/README.md

jmx_prometheus_common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.prometheus.jmx</groupId>
77
<artifactId>parent</artifactId>
8-
<version>1.0.0-SNAPSHOT</version>
8+
<version>1.0.0</version>
99
</parent>
1010

1111
<groupId>io.prometheus.jmx</groupId>

0 commit comments

Comments
 (0)