Skip to content

Commit

Permalink
In Tomcat Version 10.1.19 Spring Boot 3.2.4 Tomcat Bean Name Is Tomca… (
Browse files Browse the repository at this point in the history
  • Loading branch information
sethAmazon committed Apr 16, 2024
1 parent baf0eaa commit 07f0cbe
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions jmx-metrics/src/main/resources/target-systems/tomcat.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,29 @@ otel.instrument(beantomcatconnectors, "tomcat.threads", "The number of threads",
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
["currentThreadCount":["state":{"idle"}],"currentThreadsBusy":["state":{"busy"}]], otel.&longValueCallback)

def beantomcatnewmanager = otel.mbean("Tomcat:type=Manager,host=localhost,context=*")
otel.instrument(beantomcatnewmanager, "tomcat.sessions", "The number of active sessions.", "sessions", "activeSessions", otel.&doubleValueCallback)

def beantomcatnewrequestProcessor = otel.mbean("Tomcat:type=GlobalRequestProcessor,name=*")
otel.instrument(beantomcatnewrequestProcessor, "tomcat.errors", "The number of errors encountered.", "errors",
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
"errorCount", otel.&longCounterCallback)
otel.instrument(beantomcatnewrequestProcessor, "tomcat.request_count", "The total requests.", "requests",
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
"requestCount", otel.&longCounterCallback)
otel.instrument(beantomcatnewrequestProcessor, "tomcat.max_time", "Maximum time to process a request.", "ms",
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
"maxTime", otel.&longValueCallback)
otel.instrument(beantomcatnewrequestProcessor, "tomcat.processing_time", "The total processing time.", "ms",
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name") }],
"processingTime", otel.&longCounterCallback)
otel.instrument(beantomcatnewrequestProcessor, "tomcat.traffic",
"The number of bytes transmitted and received.", "by",
["proto_handler" : { mbean -> mbean.name().getKeyProperty("name")}],
["bytesReceived":["direction" : {"received"}], "bytesSent": ["direction" : {"sent"}]],
otel.&longCounterCallback)

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

0 comments on commit 07f0cbe

Please sign in to comment.