From 4aadcf818aba17e542a485a9450d51a53059773b Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Sun, 8 Feb 2026 23:15:00 -0500 Subject: [PATCH] Run profiler in fronted/cosole containers only (#2951) --- jetty/start.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jetty/start.sh b/jetty/start.sh index 64a0e21a8..8cb50abe0 100755 --- a/jetty/start.sh +++ b/jetty/start.sh @@ -21,8 +21,13 @@ cd webapps find . -maxdepth 1 -type d -name "console-*" -exec rm -rf {} + cd /jetty-base echo "Running ${env}" -# Use the CONTAINER_NAME variable from Kubernetes YAML to set the profiler service name. -java -agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=${CONTAINER_NAME},-cprof_enable_heap_sampling=true \ +PROFILER_ARGS="" +# # Use the CONTAINER_NAME variable from Kubernetes YAML to set Cloud profiler args, enable it only in frontend and console. +case "${CONTAINER_NAME}" in + "frontend"|"console") + PROFILER_ARGS="-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=${CONTAINER_NAME},-cprof_enable_heap_sampling=true" +esac +java $PROFILER_ARGS \ -Dgoogle.registry.environment=${env} \ -Djava.util.logging.config.file=/logging.properties \ -jar /usr/local/jetty/start.jar