# Get stack Trace details for netcore3.1 net5 version applications with Elastic APM

**URL:** <https://discuss.elastic.co/t/get-stack-trace-details-for-netcore3-1-net5-version-applications-with-elastic-apm/303168>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [April 25, 2022, 1:58pm UTC](https://discuss.elastic.co/t/get-stack-trace-details-for-netcore3-1-net5-version-applications-with-elastic-apm/303168 "2022-04-25T13:58:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [April 25, 2022, 1:58pm UTC](https://discuss.elastic.co/t/get-stack-trace-details-for-netcore3-1-net5-version-applications-with-elastic-apm/303168/1 "2022-04-25T13:58:44Z")

</div>

Hi ,

I am using Elastic APM for dotnet application-(MVC model) and following the **zero code set up method** to configure my dotnet application with elastic apm agent.  
I am unable to view the end to end flow of the api call i.e. I need to capture the classes and methods that triggered the db statement. But I can only find the Entityframeworkcore libraries .dll calls in the stack trace.  
My application is using Entityframeworkcore migrations with PostgreSQL.

Could you please help me with getting the classes and method that triggers the query in the stack trace.  
**Below is the sample result for the api call**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/d/2df2745982046e6779c3f8a4a543879e32670417.png)

**Adding the stack trace received for the above query as well.**

Elastic.Apm.Model.Span in .ctor in C:\Users\jenkins\workspace\net\_apm-agent-dotnet-mbp\_PR-1650\apm-agent-dotnet\src\Elastic.Apm\Model\Span.cs at line 114

Elastic.Apm.Model.Transaction in StartSpanInternal in C:\Users\jenkins\workspace\net\_apm-agent-dotnet-mbp\_PR-1650\apm-agent-dotnet\src\Elastic.Apm\Model\Transaction.cs at line 653

Elastic.Apm.Model.ExecutionSegmentCommon in StartSpanOnCurrentExecutionSegment in C:\Users\jenkins\workspace\net\_apm-agent-dotnet-mbp\_PR-1650\apm-agent-dotnet\src\Elastic.Apm\Model\ExecutionSegmentCommon.cs at line 307

Elastic.Apm.Model.DbSpanCommon in StartSpan in C:\Users\jenkins\workspace\net\_apm-agent-dotnet-mbp\_PR-1650\apm-agent-dotnet\src\Elastic.Apm\Model\DbSpanCommon.cs at line 32

Elastic.Apm.EntityFrameworkCore.EfCoreDiagnosticListener in HandleOnNext in C:\Users\jenkins\workspace\net\_apm-agent-dotnet-mbp\_PR-1650\apm-agent-dotnet\src\Elastic.Apm.EntityFrameworkCore\EfCoreDiagnosticListener.cs at line 40

Elastic.Apm.DiagnosticListeners.DiagnosticListenerBase in OnNext in C:\Users\jenkins\workspace\net\_apm-agent-dotnet-mbp\_PR-1650\apm-agent-dotnet\src\Elastic.Apm\DiagnosticListeners\DiagnosticListenerBase.cs at line 53

System.Diagnostics.DiagnosticListener in Write in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Microsoft.EntityFrameworkCore.Diagnostics.RelationalLoggerExtensions in BroadcastCommandExecuting in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Microsoft.EntityFrameworkCore.Diagnostics.RelationalLoggerExtensions in CommandReaderExecutingAsync in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Microsoft.EntityFrameworkCore.Storage.RelationalCommand+d\_\_17 in ExecuteReaderAsync in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in ExecutionContextCallback in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in MoveNext x 1 in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.AwaitTaskContinuation in RunOrScheduleAction in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task in RunContinuations in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task`1 in TrySetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 in SetExistingTaskResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 in SetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Microsoft.EntityFrameworkCore.Storage.RelationalConnection+d\_\_54 in OpenAsync in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in ExecutionContextCallback in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in MoveNext x 1 in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.AwaitTaskContinuation in RunOrScheduleAction in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task in RunContinuations in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task`1 in TrySetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 in SetExistingTaskResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder in SetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Microsoft.EntityFrameworkCore.Storage.RelationalConnection+d\_\_58 in OpenInternalAsync in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in ExecutionContextCallback in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in MoveNext x 1 in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.AwaitTaskContinuation in RunOrScheduleAction in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task in RunContinuations in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task`1 in TrySetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 in SetExistingTaskResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder in SetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Npgsql.NpgsqlConnection+\<\>c\_\_DisplayClass41\_0+\<g\_\_OpenAsync|0\>d in g\_\_OpenAsync|0 in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in ExecutionContextCallback in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in MoveNext x 1 in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.AwaitTaskContinuation in RunOrScheduleAction in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task in RunContinuations in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task`1 in TrySetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 in SetExistingTaskResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1 in SetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Npgsql.ConnectorPool+\<\>c\_\_DisplayClass38\_0+\<g\_\_RentAsync|0\>d in g\_\_RentAsync|0 in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in ExecutionContextCallback in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1 in MoveNext x 1 in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.AwaitTaskContinuation in RunOrScheduleAction in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task in RunContinuations in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Threading.Tasks.Task`1 in TrySetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 in SetExistingTaskResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1 in SetResult in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Npgsql.ConnectorPool+d\_\_41 in OpenNewConnector in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.15\System.Private.CoreLib.dll

Thanks in Advance.

---

<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:** [April 25, 2022, 4:48pm UTC](https://discuss.elastic.co/t/get-stack-trace-details-for-netcore3-1-net5-version-applications-with-elastic-apm/303168/2 "2022-04-25T16:48:39Z")

</div>

Hi @Namita_Jaokar,

it seems you hit the default stack trace limit which is 50. By default the agent only sends 50 stack frames in each stack trace, if you have more, they'll be cut.

You can increase this limit by changing the `StackTraceLimit` config to a higher number. The documentation about it can be found [here](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-stacktrace.html#config-stack-trace-limit).

---

<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:** [May 16, 2022, 12:49pm UTC](https://discuss.elastic.co/t/get-stack-trace-details-for-netcore3-1-net5-version-applications-with-elastic-apm/303168/3 "2022-05-16T12:49:13Z")

</div>

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