From 1a10b16788cb75fdb77fb1ec403b48ca4b795562 Mon Sep 17 00:00:00 2001 From: cleverchuk Date: Thu, 11 Jul 2024 13:54:36 -0400 Subject: [PATCH] NH-86006: enable profiling for benchmark --- .../SolarwindsProfilingSpanProcessor.java | 18 ------------------ long-running-test-arch/k8s/deployment-app.yml | 4 ++++ 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/custom/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsProfilingSpanProcessor.java b/custom/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsProfilingSpanProcessor.java index a3813bb5..365143b1 100644 --- a/custom/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsProfilingSpanProcessor.java +++ b/custom/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsProfilingSpanProcessor.java @@ -39,29 +39,11 @@ /** Span process to perform code profiling */ public class SolarwindsProfilingSpanProcessor implements SpanProcessor { - private static final Logger logger = LoggerFactory.getLogger(); private static final ProfilerSetting profilerSetting = (ProfilerSetting) ConfigManager.getConfig(ConfigProperty.PROFILER); private static final boolean PROFILER_ENABLED = profilerSetting != null && profilerSetting.isEnabled(); - static { - if (PROFILER_ENABLED) { - try { - Profiler.initialize( - profilerSetting, - ReporterFactory.getInstance() - .createQueuingEventReporter( - RpcClientManager.getClient(RpcClientManager.OperationType.PROFILING))); - } catch (ClientException e) { - logger.error("Error creating profiling report", e); - throw new RuntimeException(e); - } - } else { - logger.info("Profiler is disabled."); - } - } - @Override public void onStart(@Nonnull Context parentContext, ReadWriteSpan span) { if (span.getSpanContext().isSampled()) { // only profile on sampled spans diff --git a/long-running-test-arch/k8s/deployment-app.yml b/long-running-test-arch/k8s/deployment-app.yml index 9c85378c..1cd4d987 100644 --- a/long-running-test-arch/k8s/deployment-app.yml +++ b/long-running-test-arch/k8s/deployment-app.yml @@ -68,6 +68,8 @@ spec: value: "petclinic" - name: spring_datasource_password value: "petclinic" + - name: SW_APM_PROFILER_ENABLED + value: "true" --- apiVersion: apps/v1 @@ -124,6 +126,8 @@ spec: value: "petclinic" - name: spring_datasource_password value: "petclinic" + - name: SW_APM_PROFILER_ENABLED + value: "true" --- apiVersion: apps/v1