.Net Agent Instrumentation for IIS hosted app

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.7

Elasticsearch version: 7.7

APM Server version: 1.5

APM Agent language and version: .Net ( Elastic.Apm.AspNetFullFramework)

Browser version:chorme

Original install method (e.g. download page, yum, deb, from source, etc.) and version: nuget

Fresh install or upgraded from other version?

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

Steps to reproduce:
Hi Team ,

We are trying to instrument our .net app with Elastic APM .net agent .
We have made following changes :

added below to web.config

<system.webServer>



</system.webServer>

and

But the application is not reporting to controller .

We have validated connectivity and other basic stuff .

please help

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Hi @joychatterjee05,

I'm not sure you pasted the whole web.config file as you intended - it seems to be empty.

Have you checked this part of the docs?

not sure why it did not got pasted correctly at first.

image

Yes I referred same doc for instrumentation.

Ok, this looks good to me.

The next step would be to collect logs from the Agent - here we have details on how to do that. Can you maybe do that?

Once we have agent logs, we'll probably quickly see what's the issue based on the logs.

Hi Greg ,

Thank you for prompt reposnse.
I see application is using log4net for logging , while the above solution seems to be for nlog.

Could you please suggest and alternative .

Regards
Joy

@joychatterjee05 the solution described in the docs is general - all you need to do is to print your logs with log4net in the public void Log<TState>(ApmLogLevel apmLogLevel, TState state, Exception e, Func<TState, Exception, string> formatter) method. So it'd be almost identical to the linked nlog sample, except in the Log method you log with log4net

Hi Greg ,

We did not had an option to change application code to enable additional logging thus captured logs using DebigView , below is the error we captured .


Could you please advice .

Regards
Joy

Thanks for the log @joychatterjee05,

this seems to be an exception in our platform detection - very strange. Definitely not something we expected to happen.

I opened a GitHub issue for this: https://github.com/elastic/apm-agent-dotnet/issues/859

Could you maybe share me more info about this? Where is the app running? What .NET version, what IIS version - anything that you think could help me to debug this better?

Hello Greg ,

.NET Version is - 4.6.1
IIS Version is - 10.0
OS - Windows Server 2016

let me know if you need more information around this.

Regards
Joy

Hi Greg ,

Is there a way we can still instrument this application ?

Regards
Joy

Hi @joychatterjee05,

there was a very useful comment on the GitHub issue here - could you maybe check if that'd also solve your problem?

Also to address your question:

Is there a way we can still instrument this application ?

I hope the GitHub suggestion solves your issue, otherwise unfortunately I don't think we can make it work in that environment with the latest release.

I already merged a fix to handle the error into master - we'll publish a nightly pre-release with that, once that's out we could give you that to test and see if that helps.

But the first step should be the binding redirect from the linked GitHub issue, because I think that'd already solve the issue for you.

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