Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Tomcat Version 10.1.19 Spring Boot 3.2.4 Tomcat Bean Name Is Tomca… #1269

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading