From 9df06868fbd995690143c535d707e042f6ef4711 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Sat, 7 Aug 2021 20:07:42 +0300 Subject: [PATCH] Instrument tomcat executor (#3789) --- .../javaconcurrent/AbstractExecutorInstrumentation.java | 1 + .../tomcat/tomcat-7.0/javaagent/build.gradle.kts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/instrumentation/executors/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/javaconcurrent/AbstractExecutorInstrumentation.java b/instrumentation/executors/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/javaconcurrent/AbstractExecutorInstrumentation.java index af81e9c9b9e3..2610fca77fd0 100644 --- a/instrumentation/executors/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/javaconcurrent/AbstractExecutorInstrumentation.java +++ b/instrumentation/executors/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/javaconcurrent/AbstractExecutorInstrumentation.java @@ -87,6 +87,7 @@ protected AbstractExecutorInstrumentation() { "java.util.concurrent.ForkJoinPool", "java.util.concurrent.ScheduledThreadPoolExecutor", "java.util.concurrent.ThreadPoolExecutor", + "org.apache.tomcat.util.threads.ThreadPoolExecutor", "org.eclipse.jetty.util.thread.QueuedThreadPool", // dispatch() is covered in the jetty // module "org.eclipse.jetty.util.thread.ReservedThreadExecutor", diff --git a/instrumentation/tomcat/tomcat-7.0/javaagent/build.gradle.kts b/instrumentation/tomcat/tomcat-7.0/javaagent/build.gradle.kts index 1d39ada591b4..a3074122d400 100644 --- a/instrumentation/tomcat/tomcat-7.0/javaagent/build.gradle.kts +++ b/instrumentation/tomcat/tomcat-7.0/javaagent/build.gradle.kts @@ -13,15 +13,15 @@ muzzle { } dependencies { - library("org.apache.tomcat.embed:tomcat-embed-core:7.0.4") + compileOnly("org.apache.tomcat.embed:tomcat-embed-core:7.0.4") implementation(project(":instrumentation:tomcat:tomcat-common:javaagent")) implementation(project(":instrumentation:servlet:servlet-3.0:javaagent")) testInstrumentation(project(":instrumentation:servlet:servlet-javax-common:javaagent")) // Make sure nothing breaks due to both 7.0 and 10.0 modules being present together testInstrumentation(project(":instrumentation:tomcat:tomcat-10.0:javaagent")) - // Tests need at least version 9 to have necessary classes to configure the embedded tomcat... - // ... but not newer that version 10, because its servlet 5. - testLibrary("org.apache.tomcat.embed:tomcat-embed-core:[9.+, 10)") + testLibrary("org.apache.tomcat.embed:tomcat-embed-core:8.0.41") + testLibrary("org.apache.tomcat.embed:tomcat-embed-jasper:8.0.41") latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-core:[9.+, 10)") + latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-jasper:[9.+, 10)") } \ No newline at end of file