# Elastic APM Java Annotation API

**URL:** <https://discuss.elastic.co/t/elastic-apm-java-annotation-api/157009>\
**Category:** APM\
**Created:** [November 16, 2018, 8:45am UTC](https://discuss.elastic.co/t/elastic-apm-java-annotation-api/157009 "2018-11-16T08:45:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![digitalron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/digitalron/32/38224_2.png) [@digitalron](https://discuss.elastic.co/u/digitalron)\
**Post date:** [November 16, 2018, 1:28pm UTC](https://discuss.elastic.co/t/elastic-apm-java-annotation-api/157009/3 "2018-11-16T13:28:10Z")

</div>

Thank you very much Felix, we got it working now.

We have a follow up question on @CaptureSpan.

When we are using @CaptureSpan, we notice that each child span graph extends all the way to the end of the transaction, even if we explicitly call end() for each annotated method.

If we are using ElasticApm.createSpan() from the parent span, each method we have a trace on correctly captures the span graph as a waterfall diagram.

It's something like this:

Annotation

 ![31](https://us1.discourse-cdn.com/elastic/original/3X/1/0/105dbb653fb2635a184006e74e93babf056e6f73.png)

Code-only

 ![16](https://us1.discourse-cdn.com/elastic/original/3X/a/2/a2cb35123b1fc601e69b638e5f43dfba1bc3240b.png)

Is this expected behaviour?

---

_[View the full topic](https://discuss.elastic.co/t/elastic-apm-java-annotation-api/157009)._
