Skip to content

Commit 205b92b

Browse files
committed
fix other units
1 parent 2721add commit 205b92b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/JvmIntegrationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ protected MetricsVerifier createMetricsVerifier() {
5353
metric ->
5454
metric
5555
.hasDescription("number of loaded classes")
56-
.hasUnit("1")
56+
.hasUnit("{class}")
5757
.isGauge()
5858
.hasDataPointsWithoutAttributes())
5959
.add(
6060
"jvm.gc.collections.count",
6161
metric ->
6262
metric
6363
.hasDescription("total number of collections that have occurred")
64-
.hasUnit("1")
64+
.hasUnit("{collection}")
6565
.isCounter()
6666
.hasDataPointsWithAttributes(gcAlgorithmAttributes))
6767
.add(
@@ -174,7 +174,7 @@ protected MetricsVerifier createMetricsVerifier() {
174174
metric ->
175175
metric
176176
.hasDescription("number of threads")
177-
.hasUnit("1")
177+
.hasUnit("{thread}")
178178
.isGauge()
179179
.hasDataPointsWithoutAttributes());
180180
}

jmx-scraper/src/main/resources/jvm.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ rules:
77
LoadedClassCount:
88
metric: jvm.classes.loaded
99
type: gauge
10-
unit: '1'
10+
unit: '{class}'
1111
desc: number of loaded classes
1212

1313
- bean: java.lang:type=GarbageCollector,name=*
1414
mapping:
1515
CollectionCount:
1616
metric: jvm.gc.collections.count
1717
type: counter
18-
unit: '1'
18+
unit: '{collection}'
1919
desc: total number of collections that have occurred
2020
metricAttribute:
2121
name: param(name)
@@ -87,5 +87,5 @@ rules:
8787
mapping:
8888
ThreadCount:
8989
metric: jvm.threads.count
90-
unit: '1'
90+
unit: '{thread}'
9191
desc: number of threads

0 commit comments

Comments
 (0)