# Stack Trace on .net Agent Span

**URL:** <https://discuss.elastic.co/t/stack-trace-on-net-agent-span/192942>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [July 30, 2019, 4:09pm UTC](https://discuss.elastic.co/t/stack-trace-on-net-agent-span/192942 "2019-07-30T16:09:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xitaocrazy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xitaocrazy/32/71682_2.png) [@xitaocrazy](https://discuss.elastic.co/u/xitaocrazy)\
**Post date:** [July 30, 2019, 4:09pm UTC](https://discuss.elastic.co/t/stack-trace-on-net-agent-span/192942/1 "2019-07-30T16:09:54Z")

</div>

**APM Agent version** :  
Elastic.Apm/1.0.0-beta1

I am using the .net agent and there is no stack trace information in my spans, as in the image

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/a/8a5754ae96992d18014f7ab4280feca4d8dedae5.png)

There is a way to capture the call stack information and add it on Spans? any configuration or option in open API (I didn't find anything).

Thanks for attention.

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [July 30, 2019, 4:27pm UTC](https://discuss.elastic.co/t/stack-trace-on-net-agent-span/192942/2 "2019-07-30T16:27:35Z")

</div>

Hi @xitaocrazy,

in the `1.0.0-beta1` we only capture stack traces for outgoing `HttpClient` requests, but we recently merged a couple of PRs addressing exactly your questions. Those will be included in the next release.

In sum, we'll do in .NET what other agents do:

- Every span that takes at least 5ms will contain a stacktrace
- we add the `ELASTIC_APM_STACK_TRACE_LIMIT` config to limit the depth of the stack trace
- we add the `ELASTIC_APM_SPAN_FRAMES_MIN_DURATION` config to change the `5ms` default to capture stack traces for shorter (or only for longer) spans.

Docs: [https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-stacktrace.html](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-stacktrace.html)

All this is already on `master`.

---

<div class="post-metadata">

**Author:** ![xitaocrazy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xitaocrazy/32/71682_2.png) [@xitaocrazy](https://discuss.elastic.co/u/xitaocrazy)\
**Post date:** [July 30, 2019, 5:48pm UTC](https://discuss.elastic.co/t/stack-trace-on-net-agent-span/192942/3 "2019-07-30T17:48:26Z")

</div>

Great news, thanks @GregKalapos.  
I will publish it in my local environment to test, and keep waiting for the next release.

---

<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:** [August 20, 2019, 2:02pm UTC](https://discuss.elastic.co/t/stack-trace-on-net-agent-span/192942/4 "2019-08-20T14:02:03Z")

</div>

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