Skip to content

Commit 07f0cbe

Browse files
authored
In Tomcat Version 10.1.19 Spring Boot 3.2.4 Tomcat Bean Name Is Tomca… (#1269)
1 parent baf0eaa commit 07f0cbe

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,29 @@ otel.instrument(beantomcatconnectors, "tomcat.threads", "The number of threads",
4242
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
4343
["currentThreadCount":["state":{"idle"}],"currentThreadsBusy":["state":{"busy"}]], otel.&longValueCallback)
4444

45+
def beantomcatnewmanager = otel.mbean("Tomcat:type=Manager,host=localhost,context=*")
46+
otel.instrument(beantomcatnewmanager, "tomcat.sessions", "The number of active sessions.", "sessions", "activeSessions", otel.&doubleValueCallback)
47+
48+
def beantomcatnewrequestProcessor = otel.mbean("Tomcat:type=GlobalRequestProcessor,name=*")
49+
otel.instrument(beantomcatnewrequestProcessor, "tomcat.errors", "The number of errors encountered.", "errors",
50+
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
51+
"errorCount", otel.&longCounterCallback)
52+
otel.instrument(beantomcatnewrequestProcessor, "tomcat.request_count", "The total requests.", "requests",
53+
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
54+
"requestCount", otel.&longCounterCallback)
55+
otel.instrument(beantomcatnewrequestProcessor, "tomcat.max_time", "Maximum time to process a request.", "ms",
56+
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
57+
"maxTime", otel.&longValueCallback)
58+
otel.instrument(beantomcatnewrequestProcessor, "tomcat.processing_time", "The total processing time.", "ms",
59+
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
60+
"processingTime", otel.&longCounterCallback)
61+
otel.instrument(beantomcatnewrequestProcessor, "tomcat.traffic",
62+
"The number of bytes transmitted and received.", "by",
63+
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name")}],
64+
["bytesReceived":["direction" : {"received"}], "bytesSent": ["direction" : {"sent"}]],
65+
otel.&longCounterCallback)
66+
67+
def beantomcatnewconnectors = otel.mbean("Tomcat:type=ThreadPool,name=*")
68+
otel.instrument(beantomcatnewconnectors, "tomcat.threads", "The number of threads", "threads",
69+
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
70+
["currentThreadCount":["state":{"idle"}],"currentThreadsBusy":["state":{"busy"}]], otel.&longValueCallback)

0 commit comments

Comments
 (0)