# APM large number of spans

**URL:** <https://discuss.elastic.co/t/apm-large-number-of-spans/230413>\
**Category:** APM\
**Tags:** java\
**Created:** [April 29, 2020, 5:36pm UTC](https://discuss.elastic.co/t/apm-large-number-of-spans/230413 "2020-04-29T17:36:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Fink](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adam_fink/32/45742_2.png) [@Adam\_Fink](https://discuss.elastic.co/u/Adam_Fink)\
**Post date:** [April 29, 2020, 5:36pm UTC](https://discuss.elastic.co/t/apm-large-number-of-spans/230413/1 "2020-04-29T17:36:46Z")

</div>

We are currently setting up APM and have questions about transactions with a large number of spans.

For the APM Java Agent how does the transaction\_max\_span setting work across multiple services? If a transaction crosses two services where one service has transaction\_max\_span set to 10 and the other is set to 5, does this limit that transaction to only 5 spans?

Thanks a ton!

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [April 30, 2020, 12:34pm UTC](https://discuss.elastic.co/t/apm-large-number-of-spans/230413/2 "2020-04-30T12:34:49Z")

</div>

Hey Adam!

Please see our [data model documentation](https://www.elastic.co/guide/en/apm/get-started/current/apm-data-model.html) - a Transaction is the "entry" span on each service, so this setting will apply separately for each service, affecting the transactions created within it.  
When talking about distributed tracing across multiple services, a transaction will be created in each service and the term we use for all of them together is "trace", which will contain 2 transactions and will be limited to 15 spans altogether in your example (assuming that the first service is calling the second service exactly once).

---

<div class="post-metadata">

**Author:** ![Adam\_Fink](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adam_fink/32/45742_2.png) [@Adam\_Fink](https://discuss.elastic.co/u/Adam_Fink)\
**Post date:** [May 8, 2020, 3:35pm UTC](https://discuss.elastic.co/t/apm-large-number-of-spans/230413/3 "2020-05-08T15:35:10Z")

</div>

> [@Eyal\_Koren](#):
>
> data model documentation

Hi Eyal, This clears it up! Thank you very much for your response!

---

<div class="post-metadata">

**Author:** ![Adam\_Fink](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adam_fink/32/45742_2.png) [@Adam\_Fink](https://discuss.elastic.co/u/Adam_Fink)\
**Post date:** [May 29, 2020, 11:35am UTC](https://discuss.elastic.co/t/apm-large-number-of-spans/230413/4 "2020-05-29T11:35:13Z")

</div>

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