Skip to content

Commit ebedd5f

Browse files
committed
Units updated to align with semconv
1 parent cf0a17a commit ebedd5f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ protected MetricsVerifier createMetricsVerifier() {
5353
metric ->
5454
metric
5555
.hasDescription("The number of active sessions")
56-
.hasUnit("sessions") // TODO: not aligned with semconv. Should be "{session}"
56+
.hasUnit("{session}")
5757
.isGauge()
5858
.hasDataPointsWithOneAttribute(attributeWithAnyValue("context")))
5959
.add(
6060
"tomcat.errors",
6161
metric ->
6262
metric
6363
.hasDescription("The number of errors encountered")
64-
.hasUnit("errors") // TODO: not aligned with semconv. Should be "{error}"
64+
.hasUnit("{error}")
6565
.isCounter()
6666
.hasDataPointsWithOneAttribute(attribute("proto_handler", "\"http-nio-8080\"")))
6767
.add(
@@ -77,7 +77,7 @@ protected MetricsVerifier createMetricsVerifier() {
7777
metric ->
7878
metric
7979
.hasDescription("The number of bytes transmitted and received")
80-
.hasUnit("by") // TODO: not aligned with semconv. Should be "By"
80+
.hasUnit("By")
8181
.isCounter()
8282
.hasDataPointsWithAttributes(
8383
attributeGroup(
@@ -91,7 +91,7 @@ protected MetricsVerifier createMetricsVerifier() {
9191
metric ->
9292
metric
9393
.hasDescription("The number of threads")
94-
.hasUnit("threads") // TODO: not aligned with semconv. Should be "{thread}"
94+
.hasUnit("{thread}")
9595
.isGauge()
9696
.hasDataPointsWithAttributes(
9797
attributeGroup(
@@ -113,7 +113,7 @@ protected MetricsVerifier createMetricsVerifier() {
113113
metric ->
114114
metric
115115
.hasDescription("The total requests")
116-
.hasUnit("requests") // TODO: not aligned with semconv. Should be "{request}"
116+
.hasUnit("{request}")
117117
.isCounter()
118118
.hasDataPointsWithOneAttribute(
119119
attribute("proto_handler", "\"http-nio-8080\"")));

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ rules:
1515
activeSessions:
1616
metric: tomcat.sessions
1717
type: gauge
18-
unit: sessions
18+
unit: "{session}"
1919
desc: The number of active sessions
2020

2121
- beans:
@@ -28,12 +28,12 @@ rules:
2828
errorCount:
2929
metric: errors
3030
type: counter
31-
unit: errors
31+
unit: "{error}"
3232
desc: The number of errors encountered
3333
requestCount:
3434
metric: request_count
3535
type: counter
36-
unit: requests
36+
unit: "{request}"
3737
desc: The total requests
3838
maxTime:
3939
metric: max_time
@@ -48,14 +48,14 @@ rules:
4848
bytesSent:
4949
metric: traffic
5050
type: counter
51-
unit: by
51+
unit: By
5252
desc: The number of bytes transmitted and received
5353
metricAttribute:
5454
direction: const(sent)
5555
bytesReceived:
5656
metric: traffic
5757
type: counter
58-
unit: by
58+
unit: By
5959
desc: The number of bytes transmitted and received
6060
metricAttribute:
6161
direction: const(received)
@@ -71,13 +71,13 @@ rules:
7171
metric: threads
7272
desc: The number of threads
7373
type: gauge
74-
unit: threads
74+
unit: "{thread}"
7575
metricAttribute:
7676
state: const(idle)
7777
currentThreadsBusy:
7878
metric: threads
7979
desc: The number of threads
8080
type: gauge
81-
unit: threads
81+
unit: "{thread}"
8282
metricAttribute:
8383
state: const(busy)

0 commit comments

Comments
 (0)