# Duration field in span stacktrace

**URL:** <https://discuss.elastic.co/t/duration-field-in-span-stacktrace/175027>\
**Category:** APM\
**Created:** [April 2, 2019, 3:39pm UTC](https://discuss.elastic.co/t/duration-field-in-span-stacktrace/175027 "2019-04-02T15:39:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maddy\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maddy_m/32/45638_2.png) [@Maddy\_M](https://discuss.elastic.co/u/Maddy_M)\
**Post date:** [April 2, 2019, 3:39pm UTC](https://discuss.elastic.co/t/duration-field-in-span-stacktrace/175027/1 "2019-04-02T15:39:01Z")

</div>

**Kibana version** : 6.4.0

**Elasticsearch version** : 6.4.0

**APM Server version** : 6.7.0

**APM Agent language and version** : java 1.5

**Browser version** : Chrome Version 72.0.3626.121

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: download page

**Fresh install or upgraded from other version?** NA

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc. No

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

I am using java agent 1.5 and added to tomcat start up to collect traces. I am ale to see each transaction in apm-\* index. For DB queries, I can see "Duration" for all select queries in span details.

In span details, I want to see "Duration" for each line of code execution along with line number. I can see only line number at the moment in "span.stacktrace"

**Example** :

Below is from span details page.

"#### Stacktraces"

14 library frames

HttpURLConnection.java in getResponseCode at line 480

HTTPConduit.java in handleResponseInternal at line 1612

HTTPConduit.java in handleResponse at line 1538

HTTPConduit.java in close at line 1445

**From View Span Discover**

**Is there a way to get duration in abs\_path along with line number?**

"stacktrace": [  
{  
"exclude\_from\_grouping": false,  
"library\_frame": true,  
"filename": "HttpURLConnection.java",  
"abs\_path": "java.net.HttpURLConnection",  
"line": {  
"number": 480  
},  
"function": "getResponseCode"  
},  
{  
"library\_frame": true,  
"exclude\_from\_grouping": false,  
"abs\_path": "org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream",  
"filename": "HTTPConduit.java",  
"line": {  
"number": 1612  
},  
"function": "handleResponseInternal"  
},  
{  
"library\_frame": true,  
"exclude\_from\_grouping": false,  
"filename": "HTTPConduit.java",  
"abs\_path": "org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream",  
"line": {  
"number": 1538  
},  
"function": "handleResponse"  
},

---

<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:** [April 2, 2019, 3:57pm UTC](https://discuss.elastic.co/t/duration-field-in-span-stacktrace/175027/2 "2019-04-02T15:57:50Z")

</div>

Hi and thanks for your question 🙂

I think what you are looking for is the `trace_methods` configuration option: [https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-trace-methods](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-trace-methods)

Let me know if that works for you.

Thanks,  
Felix

---

<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:** [April 23, 2019, 11:57am UTC](https://discuss.elastic.co/t/duration-field-in-span-stacktrace/175027/3 "2019-04-23T11:57:54Z")

</div>

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