# Handle Span drop message in APM Java agent

**URL:** <https://discuss.elastic.co/t/handle-span-drop-message-in-apm-java-agent/205414>\
**Category:** APM\
**Tags:** java\
**Created:** [October 28, 2019, 7:49am UTC](https://discuss.elastic.co/t/handle-span-drop-message-in-apm-java-agent/205414 "2019-10-28T07:49:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rijash](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@rijash](https://discuss.elastic.co/u/rijash)\
**Post date:** [October 28, 2019, 7:49am UTC](https://discuss.elastic.co/t/handle-span-drop-message-in-apm-java-agent/205414/1 "2019-10-28T07:49:17Z")

</div>

**Kibana version** : 7.4.0

**Elasticsearch version** : 7.4.0

**APM Server version** : 7.4.0

**APM Agent language and version** : Java and 1.9.0

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

We are observing span drop is happening, while trying to collect the APM data with " **trace\_methods**" enabled.  
We tried to increase the " **transaction\_max\_spans**" to 50,000, but still it is there.

Could you please help here, to get all the span details without any drop.

Thanks.

regards,  
rijash

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [October 28, 2019, 8:41am UTC](https://discuss.elastic.co/t/handle-span-drop-message-in-apm-java-agent/205414/2 "2019-10-28T08:41:32Z")

</div>

Hi,

you can try to increase the [`max_queue_size`](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-max-queue-size) of the agent and/or the [APM Server queue size](https://www.elastic.co/guide/en/apm/server/current/tune-apm-server.html#adjust-queue-size).

Note that Elastic APM is not meant for or optimized for handling that many spans. What's your use case? Are you using the [`trace_methods`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-trace-methods) option with wildcards?

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![rijash](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@rijash](https://discuss.elastic.co/u/rijash)\
**Post date:** [October 28, 2019, 9:45am UTC](https://discuss.elastic.co/t/handle-span-drop-message-in-apm-java-agent/205414/3 "2019-10-28T09:45:37Z")

</div>

Hi Felix,

Many thanks for your quick help here.

The trace\_methods option is not mentioned complete wildcards in project level,but yes it is wild card inside a specific package.

Use case is to get all the details(spans) for a specific transaction call inside a Java class.

Thanks.

Regards,  
Rijash

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 18, 2019, 5:45am UTC](https://discuss.elastic.co/t/handle-span-drop-message-in-apm-java-agent/205414/4 "2019-11-18T05:45:39Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
