Skip to content

Commit 9d29aa9

Browse files
committed
Tomcat metrics definitions updated in JMX Scraper
1 parent 5c6be9d commit 9d29aa9

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,26 @@ protected MetricsVerifier createMetricsVerifier() {
5454
metric
5555
.hasDescription("The number of active sessions")
5656
.hasUnit("{session}")
57-
.isGauge()
57+
.isUpDownCounter()
5858
.hasDataPointsWithOneAttribute(attributeWithAnyValue("context")))
5959
.add(
60-
"tomcat.errors",
60+
"tomcat.request.errors",
6161
metric ->
6262
metric
6363
.hasDescription("The number of errors encountered")
6464
.hasUnit("{error}")
6565
.isCounter()
6666
.hasDataPointsWithOneAttribute(attribute("proto_handler", "\"http-nio-8080\"")))
6767
.add(
68-
"tomcat.processing_time",
68+
"tomcat.request.duration",
6969
metric ->
7070
metric
7171
.hasDescription("The total processing time")
7272
.hasUnit("ms")
7373
.isCounter()
7474
.hasDataPointsWithOneAttribute(attribute("proto_handler", "\"http-nio-8080\"")))
7575
.add(
76-
"tomcat.traffic",
76+
"tomcat.network.io",
7777
metric ->
7878
metric
7979
.hasDescription("The number of bytes transmitted and received")
@@ -101,15 +101,15 @@ protected MetricsVerifier createMetricsVerifier() {
101101
attribute("state", "busy"),
102102
attribute("proto_handler", "\"http-nio-8080\""))))
103103
.add(
104-
"tomcat.max_time",
104+
"tomcat.request.duration.max",
105105
metric ->
106106
metric
107107
.hasDescription("Maximum time to process a request")
108108
.hasUnit("ms")
109109
.isGauge()
110110
.hasDataPointsWithOneAttribute(attribute("proto_handler", "\"http-nio-8080\"")))
111111
.add(
112-
"tomcat.request_count",
112+
"tomcat.requests",
113113
metric ->
114114
metric
115115
.hasDescription("The total requests")

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rules:
1414
mapping:
1515
activeSessions:
1616
metric: tomcat.sessions
17-
type: gauge
17+
type: updowncounter
1818
unit: "{session}"
1919
desc: The number of active sessions
2020

@@ -26,37 +26,37 @@ rules:
2626
proto_handler: param(name)
2727
mapping:
2828
errorCount:
29-
metric: errors
29+
metric: request.errors
3030
type: counter
3131
unit: "{error}"
3232
desc: The number of errors encountered
3333
requestCount:
34-
metric: request_count
34+
metric: requests
3535
type: counter
3636
unit: "{request}"
3737
desc: The total requests
3838
maxTime:
39-
metric: max_time
39+
metric: request.duration.max
4040
type: gauge
4141
unit: ms
4242
desc: Maximum time to process a request
4343
processingTime:
44-
metric: processing_time
44+
metric: request.duration
4545
type: counter
4646
unit: ms
4747
desc: The total processing time
4848
bytesSent:
49-
metric: traffic
50-
type: counter
51-
unit: By
52-
desc: The number of bytes transmitted and received
49+
metric: &metric network.io
50+
type: &type counter
51+
unit: &unit By
52+
desc: &desc The number of bytes transmitted and received
5353
metricAttribute:
5454
direction: const(sent)
5555
bytesReceived:
56-
metric: traffic
57-
type: counter
58-
unit: By
59-
desc: The number of bytes transmitted and received
56+
metric: *metric
57+
type: *type
58+
unit: *unit
59+
desc: *desc
6060
metricAttribute:
6161
direction: const(received)
6262

@@ -68,16 +68,16 @@ rules:
6868
proto_handler: param(name)
6969
mapping:
7070
currentThreadCount:
71-
metric: threads
72-
desc: The number of threads
73-
type: gauge
74-
unit: "{thread}"
71+
metric: &metric threads
72+
desc: &desc The number of threads
73+
type: &type gauge
74+
unit: &unit "{thread}"
7575
metricAttribute:
7676
state: const(idle)
7777
currentThreadsBusy:
78-
metric: threads
79-
desc: The number of threads
80-
type: gauge
81-
unit: "{thread}"
78+
metric: *metric
79+
desc: *desc
80+
type: *type
81+
unit: *unit
8282
metricAttribute:
8383
state: const(busy)

0 commit comments

Comments
 (0)