Skip to content

Commit d286b7a

Browse files
committed
Update JMX Metrics Gatherer units definitions for Cassandra to match semconv
1 parent ebedd5f commit d286b7a

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

jmx-metrics/src/integrationTest/java/io/opentelemetry/contrib/jmxmetrics/target_systems/TomcatIntegrationTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ class TomcatIntegrationTest extends AbstractIntegrationTest {
5353
void endToEnd() {
5454
waitAndAssertMetrics(
5555
metric ->
56-
assertGauge(metric, "tomcat.sessions", "The number of active sessions.", "sessions"),
56+
assertGauge(metric, "tomcat.sessions", "The number of active sessions.", "{session}"),
5757
metric ->
5858
assertSumWithAttributes(
5959
metric,
6060
"tomcat.errors",
6161
"The number of errors encountered.",
62-
"errors",
62+
"{error}",
6363
attrs -> attrs.containsOnly(entry("proto_handler", "\"http-nio-8080\""))),
6464
metric ->
6565
assertSumWithAttributes(
@@ -73,7 +73,7 @@ void endToEnd() {
7373
metric,
7474
"tomcat.traffic",
7575
"The number of bytes transmitted and received.",
76-
"by",
76+
"By",
7777
attrs ->
7878
attrs.containsOnly(
7979
entry("proto_handler", "\"http-nio-8080\""), entry("direction", "sent")),
@@ -86,7 +86,7 @@ void endToEnd() {
8686
metric,
8787
"tomcat.threads",
8888
"The number of threads",
89-
"threads",
89+
"{thread}",
9090
attrs ->
9191
attrs.containsOnly(
9292
entry("proto_handler", "\"http-nio-8080\""), entry("state", "idle")),
@@ -105,7 +105,7 @@ void endToEnd() {
105105
metric,
106106
"tomcat.request_count",
107107
"The total requests.",
108-
"requests",
108+
"{request}",
109109
attrs -> attrs.containsOnly(entry("proto_handler", "\"http-nio-8080\""))));
110110
}
111111
}

jmx-metrics/src/main/resources/target-systems/tomcat.groovy

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

1717

1818
def beantomcatmanager = otel.mbeans("Catalina:type=Manager,host=localhost,context=*")
19-
otel.instrument(beantomcatmanager, "tomcat.sessions", "The number of active sessions.", "sessions", "activeSessions", otel.&longValueCallback)
19+
otel.instrument(beantomcatmanager, "tomcat.sessions", "The number of active sessions.", "{session}", "activeSessions", otel.&longValueCallback)
2020

2121
def beantomcatrequestProcessor = otel.mbeans("Catalina:type=GlobalRequestProcessor,name=*")
22-
otel.instrument(beantomcatrequestProcessor, "tomcat.errors", "The number of errors encountered.", "errors",
22+
otel.instrument(beantomcatrequestProcessor, "tomcat.errors", "The number of errors encountered.", "{error}",
2323
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
2424
"errorCount", otel.&longCounterCallback)
25-
otel.instrument(beantomcatrequestProcessor, "tomcat.request_count", "The total requests.", "requests",
25+
otel.instrument(beantomcatrequestProcessor, "tomcat.request_count", "The total requests.", "{request}",
2626
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
2727
"requestCount", otel.&longCounterCallback)
2828
otel.instrument(beantomcatrequestProcessor, "tomcat.max_time", "Maximum time to process a request.", "ms",
@@ -32,24 +32,24 @@ otel.instrument(beantomcatrequestProcessor, "tomcat.processing_time", "The total
3232
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
3333
"processingTime", otel.&longCounterCallback)
3434
otel.instrument(beantomcatrequestProcessor, "tomcat.traffic",
35-
"The number of bytes transmitted and received.", "by",
35+
"The number of bytes transmitted and received.", "By",
3636
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name")}],
3737
["bytesReceived":["direction" : {"received"}], "bytesSent": ["direction" : {"sent"}]],
3838
otel.&longCounterCallback)
3939

4040
def beantomcatconnectors = otel.mbeans("Catalina:type=ThreadPool,name=*")
41-
otel.instrument(beantomcatconnectors, "tomcat.threads", "The number of threads", "threads",
41+
otel.instrument(beantomcatconnectors, "tomcat.threads", "The number of threads", "{thread}",
4242
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
4343
["currentThreadCount":["state":{"idle"}],"currentThreadsBusy":["state":{"busy"}]], otel.&longValueCallback)
4444

4545
def beantomcatnewmanager = otel.mbeans("Tomcat:type=Manager,host=localhost,context=*")
46-
otel.instrument(beantomcatnewmanager, "tomcat.sessions", "The number of active sessions.", "sessions", "activeSessions", otel.&longValueCallback)
46+
otel.instrument(beantomcatnewmanager, "tomcat.sessions", "The number of active sessions.", "{session}", "activeSessions", otel.&longValueCallback)
4747

4848
def beantomcatnewrequestProcessor = otel.mbeans("Tomcat:type=GlobalRequestProcessor,name=*")
49-
otel.instrument(beantomcatnewrequestProcessor, "tomcat.errors", "The number of errors encountered.", "errors",
49+
otel.instrument(beantomcatnewrequestProcessor, "tomcat.errors", "The number of errors encountered.", "{error}",
5050
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
5151
"errorCount", otel.&longCounterCallback)
52-
otel.instrument(beantomcatnewrequestProcessor, "tomcat.request_count", "The total requests.", "requests",
52+
otel.instrument(beantomcatnewrequestProcessor, "tomcat.request_count", "The total requests.", "{request}",
5353
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
5454
"requestCount", otel.&longCounterCallback)
5555
otel.instrument(beantomcatnewrequestProcessor, "tomcat.max_time", "Maximum time to process a request.", "ms",
@@ -59,12 +59,12 @@ otel.instrument(beantomcatnewrequestProcessor, "tomcat.processing_time", "The to
5959
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
6060
"processingTime", otel.&longCounterCallback)
6161
otel.instrument(beantomcatnewrequestProcessor, "tomcat.traffic",
62-
"The number of bytes transmitted and received.", "by",
62+
"The number of bytes transmitted and received.", "By",
6363
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name")}],
6464
["bytesReceived":["direction" : {"received"}], "bytesSent": ["direction" : {"sent"}]],
6565
otel.&longCounterCallback)
6666

6767
def beantomcatnewconnectors = otel.mbeans("Tomcat:type=ThreadPool,name=*")
68-
otel.instrument(beantomcatnewconnectors, "tomcat.threads", "The number of threads", "threads",
68+
otel.instrument(beantomcatnewconnectors, "tomcat.threads", "The number of threads", "{thread}",
6969
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
7070
["currentThreadCount":["state":{"idle"}],"currentThreadsBusy":["state":{"busy"}]], otel.&longValueCallback)

0 commit comments

Comments
 (0)