I am new to dotnet developement, can anyone explain why the filename is a dll not the .cs source code containing the class and the function - link to source code with the function
Environment variables used for profiler auto instrumentation:
set CORECLR_ENABLE_PROFILING=1
set CORECLR_PROFILER={FA65FE15-F085-4681-9B20-95E04F6C03CC}
set CORECLR_PROFILER_PATH=D:\DotNet\elastic_apm_profiler_1.18.0\elastic_apm_profiler.dll
set ELASTIC_APM_PROFILER_HOME=D:\DotNet\elastic_apm_profiler_1.18.0
set ELASTIC_APM_PROFILER_INTEGRATIONS=D:\DotNet\elastic_apm_profiler_1.18.0\integrations.yml
set ELASTIC_APM_SPAN_STACK_TRACE_MIN_DURATION=0ms
set ELASTIC_APM_STACK_TRACE_LIMIT=-1
set ELASTIC_APM_SERVICE_NAME=CourseLibraryApp
this is because C# is a compiled language. Once you compile a .cs file, the output will be a .dll containing the byte-code - this is also known as the .NET assembly. So when your program runs, there is no .cs file with source code visible to the runtime since the runtime works with the compiled assemblies which are the .dll files.
The unfortunate consequence of this from an APM Agent's point of view is that the Elastic APM Agent is unable to determine from which .cs file a given method is coming from and only reports the .dll file.
Nevertheless, we still report the fully qualified class name in classname, so that should be enough to identify which class/method you see in a given stack frame.
@GregKalapos thank you for the reply.
I have also done profiler auto instrumentation for another asp .net core application targeting net6.0. NopCommerce
For this application I was getting correct filename in the span stacktrace.
I have also done profiler auto instrumentation for another asp .net core application targeting net6.0 . NopCommerce
For this application I was getting correct filename in the span stacktrace.
Can you explain this behaviour?
So, in additional to what I wrote in the previous answer, the agent actually tries to find the .cs file if possible - so indeed, the agent has a "best effort" mechanism to figure out the original .cs file, if this fails, the agent just reports the assembly (which is the .dll file) that is executed during runtime.
That can determine the .cs file when debugging symbols are present and currently set up. If that method returns null, the agent just reports .dll files as the file name.
Configure elastic dotnet apm agent v1.18.0 for profiler auto instrumentatiion with following environment variables
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
Launch the dotnet application from directory CourseLibrary\CourseLibrary.API\bin\Debug\netcoreapp3.1 by using the command dotnet CourseLibrary.API.dll
Hit one of the rest api : http://localhost:5000/api/authors
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.