# Custom transcation can not see its span

**URL:** <https://discuss.elastic.co/t/custom-transcation-can-not-see-its-span/234506>\
**Category:** APM\
**Tags:** java\
**Created:** [May 27, 2020, 9:51am UTC](https://discuss.elastic.co/t/custom-transcation-can-not-see-its-span/234506 "2020-05-27T09:51:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhipengLin](https://avatars.discourse-cdn.com/v4/letter/z/7ea924/32.png) [@zhipengLin](https://discuss.elastic.co/u/zhipengLin)\
**Post date:** [May 27, 2020, 9:51am UTC](https://discuss.elastic.co/t/custom-transcation-can-not-see-its-span/234506/1 "2020-05-27T09:51:41Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** :  
7.7  
**Elasticsearch version** :  
7.7  
**APM Server version** :  
7.7  
**APM Agent language and version** :  
JAVA 8  
  
co.elastic.apm  
apm-agent-api  
1.14.0  
  
**Browser version** :  
chrome

I custom a transcation named KAFKA , I use the AOP around to capture the method ,  
the method has some database operation  
Now I can see the transcation on the kibana,  
but It does not show its span  
forexample the db span.

 ![nospan](https://us1.discourse-cdn.com/elastic/original/3X/d/4/d4584896bd9846776198ea50547375a79f5e3bff.png)

---

<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:** [May 27, 2020, 10:07am UTC](https://discuss.elastic.co/t/custom-transcation-can-not-see-its-span/234506/2 "2020-05-27T10:07:08Z")

</div>

Maybe you forgot to [`activate()`](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-transaction-activate) the transaction?

---

<div class="post-metadata">

**Author:** ![zhipengLin](https://avatars.discourse-cdn.com/v4/letter/z/7ea924/32.png) [@zhipengLin](https://discuss.elastic.co/u/zhipengLin)\
**Post date:** [May 27, 2020, 12:08pm UTC](https://discuss.elastic.co/t/custom-transcation-can-not-see-its-span/234506/3 "2020-05-27T12:08:19Z")

</div>

thank you for your support ,you are right

---

<div class="post-metadata">

**Author:** ![zhipengLin](https://avatars.discourse-cdn.com/v4/letter/z/7ea924/32.png) [@zhipengLin](https://discuss.elastic.co/u/zhipengLin)\
**Post date:** [May 27, 2020, 12:18pm UTC](https://discuss.elastic.co/t/custom-transcation-can-not-see-its-span/234506/4 "2020-05-27T12:18:01Z")

</div>

I have an another question . the default transication is the http request, the default span is the sql, If I set the sql operation as transication by the api, can the http transcation and the sql transcation related correctly ?

---

<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:** [May 28, 2020, 9:55am UTC](https://discuss.elastic.co/t/custom-transcation-can-not-see-its-span/234506/5 "2020-05-28T09:55:23Z")

</div>

I'm not sure I get your question. A SQL operation cannot be a transaction. The transaction is the first span (aka entry point) in your service. If you activate your custom transaction, the built-in JDBC instrumentation can add a JDBC span as the child of your custom transaction.

---

<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:** [June 18, 2020, 5:55am UTC](https://discuss.elastic.co/t/custom-transcation-can-not-see-its-span/234506/6 "2020-06-18T05:55:42Z")

</div>

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