diff --git a/jmx-metrics/src/main/resources/target-systems/tomcat.groovy b/jmx-metrics/src/main/resources/target-systems/tomcat.groovy index ca164621f..ab3f54113 100644 --- a/jmx-metrics/src/main/resources/target-systems/tomcat.groovy +++ b/jmx-metrics/src/main/resources/target-systems/tomcat.groovy @@ -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)