From db2699a66264eaf4f73408dbc86c9b923f990d39 Mon Sep 17 00:00:00 2001 From: Moritz Mack Date: Fri, 31 Oct 2025 11:43:23 +0100 Subject: [PATCH] Skip generation of stacktraces for APM spans. For ES, these stacktraces are generally of fairly little use as these would almost always point to APMTracer.stopTrace being called from TaskManager.unregister. Because of above and as part of the effort to reduce costs of tracing and make it more lightweight, we should just not include stacktraces at all. Relates to ES-12935 --- .../java/org/elasticsearch/server/cli/APMJvmOptions.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/APMJvmOptions.java b/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/APMJvmOptions.java index 9cf9e38aeed20..46e7e6bddeccf 100644 --- a/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/APMJvmOptions.java +++ b/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/APMJvmOptions.java @@ -81,7 +81,10 @@ class APMJvmOptions { "metrics_interval", "120s", "breakdown_metrics", "false", "central_config", "false", - "transaction_sample_rate", "0.2" + "transaction_sample_rate", "0.2", + // Don't collect stacktraces for spans, typically these are of little use as + // always pointing to APMTracer.stopTrace invoked from TaskManager + "stack_trace_limit", "0" ); // end::noformat