# Java APM has no spans

**URL:** https://discuss.elastic.co/t/java-apm-has-no-spans/162610
**Category:** APM
**Created:** [January 2, 2019, 8:48am UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610 "2019-01-02T08:48:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mrk1](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mrk1](https://discuss.elastic.co/u/mrk1)
#### Post date: [January 2, 2019, 8:48am UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610/1 "2019-01-02T08:48:07Z")

</div>

hi i have setup JavaAPM in my kibana ui , i am not able to see any transactions error :  
"No spans available for this transaction. "  
i do get response times and request per minute .

---

<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: [January 2, 2019, 8:58am UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610/2 "2019-01-02T08:58:36Z")

</div>

Hi and thanks for trying out our APM solution.  
What type of spans are you expecting that correspond technologies/frameworks listed in [our supported technologies page](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html)?

---

<div class="post-metadata">

### Author: ![mrk1](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mrk1](https://discuss.elastic.co/u/mrk1)
#### Post date: [January 2, 2019, 9:09am UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610/3 "2019-01-02T09:09:07Z")

</div>

hi,  
Spring Boot

1.5+, 2.x

---

<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: [January 2, 2019, 9:13am UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610/4 "2019-01-02T09:13:36Z")

</div>

Those are why you see transactions. Which **spans** do you expect?  
Spans represent events of special interest like querying a DB or making a remote call. Alternatively, you can create custom spans to trace anything you want in your code using the [public API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html), and soon also third party code.

---

<div class="post-metadata">

### Author: ![mrk1](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mrk1](https://discuss.elastic.co/u/mrk1)
#### Post date: [January 2, 2019, 9:32am UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610/5 "2019-01-02T09:32:04Z")

</div>

i think custom spans is what i needed. Thanks for this .

---

<div class="post-metadata">

### Author: ![mrk1](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mrk1](https://discuss.elastic.co/u/mrk1)
#### Post date: [January 3, 2019, 10:43am UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610/6 "2019-01-03T10:43:12Z")

</div>

HI ,  
i have a question i am getting traces for api's but the trace is not divided into the individual steps it only shows a single line on clicking i get to see the line numbers of the java code that got executed , how can i set split of the trace as it travels through the code ?  
TIA

---

<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: [January 3, 2019, 12:14pm UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610/7 "2019-01-03T12:14:49Z")

</div>

Please follow carefully the explanations and instructions in the API documentation. It is very important to understand the lifecycles of Transactions and Spans in order to get them with the right relationships.  
Few guidelines:

- Make sure a Transaction is **created and activated** at the beginning of a trace you want to record and ended when the request handling is over.
- Make sure you use the right API to create a Span as a child of its parent span/transaction and activate/deactivate it
- If suits your needs, try using the [annotation API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-annotation) as it removes some of the heavy lifting of lifecycle and activation/deactivation

If you spend some time understanding this and it still doesn't work, please attach a screenshot to accompany your explanations.

Thanks and good luck.

---

<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: [January 24, 2019, 8:27am UTC](https://discuss.elastic.co/t/java-apm-has-no-spans/162610/8 "2019-01-24T08:27:04Z")

</div>

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