# DB Span Stacktrace reporting wrong filename

**URL:** <https://discuss.elastic.co/t/db-span-stacktrace-reporting-wrong-filename/329485>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [April 6, 2023, 6:50am UTC](https://discuss.elastic.co/t/db-span-stacktrace-reporting-wrong-filename/329485 "2023-04-06T06:50:34Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![AbhijithCV](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@AbhijithCV](https://discuss.elastic.co/u/AbhijithCV)\
**Post date:** [April 10, 2023, 6:20am UTC](https://discuss.elastic.co/t/db-span-stacktrace-reporting-wrong-filename/329485/5 "2023-04-10T06:20:36Z")

</div>

> Is this question related to that entry. That indeed seems to be a bug (not sure yet, I need to dig deeper).

Yes its related.  
I am provding steps to repoduce

**Kibana version** : 8.1.2  
**Elasticsearch version** : 8.1.2  
**APM Server version** : 8.1.2  
**APM Agent language and version** : dotnet agent version: 1.18.0

1. Clone the repo - [BuildingRESTfulAPIAspNetCore3/Finished sample/CourseLibrary at master · KevinDockx/BuildingRESTfulAPIAspNetCore3 · GitHub](https://github.com/KevinDockx/BuildingRESTfulAPIAspNetCore3/tree/master/Finished%20sample/CourseLibrary)
2. Build the application - `dotnet build`
3. Configure elastic dotnet apm agent `v1.18.0` for `profiler auto instrumentatiion` with following environment variables

```auto
set CORECLR_ENABLE_PROFILING=1
set CORECLR_PROFILER={FA65FE15-F085-4681-9B20-95E04F6C03CC}
set CORECLR_PROFILER_PATH=<agent_path>\elastic_apm_profiler.dll
set ELASTIC_APM_PROFILER_HOME=<agent_path>
set ELASTIC_APM_PROFILER_INTEGRATIONS=<agent_path>\integrations.yml
set ELASTIC_APM_SPAN_STACK_TRACE_MIN_DURATION=0ms
set ELASTIC_APM_STACK_TRACE_LIMIT=-1
set ELASTIC_APM_SERVICE_NAME=CourseLibraryApp

```

1. Launch the dotnet application from directory `CourseLibrary\CourseLibrary.API\bin\Debug\netcoreapp3.1` by using the command `dotnet CourseLibrary.API.dll`
2. Hit one of the rest api : `http://localhost:5000/api/authors`
3. Check the db span stacktrace from Kibana.

```auto
{
                "exclude_from_grouping" : false,
                "filename" : """C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.32\System.Private.CoreLib.dll""",
                "classname" : "CourseLibrary.API.Controllers.AuthorsController",
                "line" : {
                  "number" : 0
                },
                "function" : "GetAuthors",
                "module" : "CourseLibrary.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
              }

```

`GetAuthors` function is part of the application, but its filename is wrong.  
[Course Library application - GetAuthors function](https://github.com/KevinDockx/BuildingRESTfulAPIAspNetCore3/blob/e2fe73add93c232ec5c7fe6747ae1fe5d056c983/Finished%20sample/CourseLibrary/CourseLibrary.API/Services/CourseLibraryRepository.cs#L126)

Question: Agent should have resolved the filename right? since the symbol file .pdb is available.

---

_[View the full topic](https://discuss.elastic.co/t/db-span-stacktrace-reporting-wrong-filename/329485)._
