Elastic APM Transaction are not showing in ASP.NET MVC Classic Framework

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text :slight_smile:

Kibana version:
7.5

Elasticsearch version:
7.5
APM Server version:
7.6
APM Agent language and version:
ASP.NET MVC (Classic) FrameWork Version 4.7.03062

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
Not seeing any transaction or error from IIS ASP.NET MVC framework after configured elastic APM.

Blow are to configuration in web.config

Tried to web site to get Transaction, but it is not showing.

Hi @pvssraju, welcome on the forum.

I don't see the web.config - I guess it's missing. Could you take another try and add it?

Thanks,
Greg

Below are the web.config I added

<add key="ElasticApm:ServerUrls" value="http://xxxxxxxxxxxx:8200" />
<add key="ElasticApm:ServiceName" value="xxxxxxx" />
<add key="ElasticApm:Environment" value="Dev" />
<add key="ElasticApm:LogLevel" value="Debug" />
<add key="ElasticApm:StackTraceLimit" value="-1" />
<add key="ElasticApm:SpanFramesMinDuration" value="-1ms" />
<add key="ElasticApm:TransactionSampleRate" value="1.0" />
<add key="ElasticApm:CaptureBody" value="all" />

@pvssraju is this all under <configuration> <appSettings> , like this?

<?xml version="1.0" encoding="utf-8"?>
<!-- ... -->
<configuration>
    <!-- ... -->
    <appSettings>
        <!-- ... -->
        <add key="ElasticApm:ServerUrls" value="https://my-apm-server:8200" />
    </appSettings>
    <!-- ... -->
</configuration>

Also, maybe another idea: where is the server running, do you maybe also need to set the secret token? (you need that if this runs in elastic cloud)

Yes
we are calling under
<configuration> <appSettings file="configs\AppSettings.config">

we are using OpenSource in our own servers.

Ok, so what I see from the config, it looks ok.

Do you have some logging system in place? We could look at the agent logs, if we turn those to trace probably we'll se what's going on here.

Hi Greg,
Yes we are using Serilog for application and log4net, below are the settings

<!--==============Serilog Configurations-->
<add key="isRollingFileLoggingEnabled" value="true"/>
<add key="filePathFormat" value="C:\\Errlogs\\xxxxx.serilog-{Date}.txt"/>
<add key="retainedFileCountLimit" value="10"/>
<!--Possible level values: Verbose, Debug, Information, Warning, Error, Fatal -->
<add key="rollingFileMinimumLevel" value="Information"/>
<add key="SerilogApplication" value="xxxxxxx-DEV"/>

Hi Greg,

Did you got chance to look this issue?

Hey @pvssraju,

sorry for the late reply.

Ok, so, one idea could be to move the agent logs into serilog. You can configure this in the Application_Start method. Here is an example for that.

So basically you'll need to implement the IApmLogger interface - this is an example of that for NLog - and then in the Application_Start you need to set AgentDependencies.Logger to your implementation of IApmLogger which directs logs to serilog. From that point the agent will write all the logs to serilig.

What that we'll see the agent logs and hopefully we'll know what's the issue here.

I am working with DEV Team and do some changes in they code and will let you know if any helpful information we see.

Perfect, thanks @pvssraju - ideally the logs will already show the root cause - I expect some connection issue between the APM Server and the agent; of course this is just speculation, the logs will tell us what really happens.

I already checked connection between servers and able to telnet to port 8200 from agent.

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