App agent blocking application startup with activation leak error

Elasticsearch version: 7.17.1

APM Server version: 7.15.0

APM Agent language and version: Java / 1.47.1

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant): After adding the transaction_max_spans=1 property in the elasticapm.properties file, the application throws below error on startup and crashes.
Provide logs and/or server output (if relevant):

2024-05-16 11:11:02,526 [http-nio-8080-exec-1] WARN co.elastic.apm.agent.impl.transaction.Span - Max spans (1) for transaction '' 00-f20cdf84e12b32f0be889aea2cadc9ba-37559b8798182bac-01 (7fa9ca81) has been reached. For this transaction and possibly others, further spans will be dropped. See config param 'transaction_max_spans'.
2024-05-16 11:11:02,430 [http-nio-8080-exec-2] ERROR co.elastic.apm.agent.impl.ActiveStack - Activation stack depth reached its maximum - 1. This is likely related to activation leak. Current transaction: '' 00-161a1f97d7527cb39229d18fb82c9dcd-14c3825251226a79-01 (6554993d)
java.lang.Throwable: Stack of threshold-crossing activation:
at co.elastic.apm.agent.impl.ActiveStack.activate(ActiveStack.java:89) [elastic-apm-agent.jar:1.47.1]
at co.elastic.apm.agent.impl.ElasticApmTracer.activate(ElasticApmTracer.java:865) [elastic-apm-agent.jar:1.47.1]
at co.elastic.apm.agent.impl.transaction.ElasticContext.activate(ElasticContext.java:63) [elastic-apm-agent.jar:1.47.1]
at co.elastic.apm.agent.impl.transaction.ElasticContext.activate(ElasticContext.java:32) [elastic-apm-agent.jar:1.47.1]
at co.elastic.apm.agent.redis.RedisSpanUtils.createRedisSpan(RedisSpanUtils.java:40) [elastic-apm-agent.jar:1.47.1]
at co.elastic.apm.agent.jedis.SendCommandAdvice.sendCommandEntry(SendCommandAdvice.java:35) [elastic-apm-agent.jar:?]
at redis.clients.jedis.Connection.sendCommand(Connection.java:95) [jedis-2.8.1.jar:?]
at redis.clients.jedis.BinaryClient.ping(BinaryClient.java:93) [jedis-2.8.1.jar:?]
at redis.clients.jedis.BinaryJedis.ping(BinaryJedis.java:105) [jedis-2.8.1.jar:?]

that value makes no sense. I'd advise not to set it to 1. No low value makes sense

actually, it was working with 0 in older version, after we upgraded the version, started facing this issue. We don't want to store the spans, as it consumes lot of storage and not very useful in our case.
In either case, Why does a lower value block the application startup ?

bug issue opened at Agent crashes when transaction_max_spans=1 · Issue #3642 · elastic/apm-agent-java · GitHub

1 Like