I want to instrument asp.net MVC application with Elastic APM agent and got through this link Configuration on ASP.NET | APM .NET Agent Reference [1.12] | Elastic which requires to add the configuration in the web.config file of the application.
Is there a way to configure the application without making changes in the application, Like the way we have it in the aspnet core applications with zero code changes method of configuration.
Secondly, I want to configure my aspnetcore application by deploying it in IIS server. Until now I have tried configuring the elastic apm agent with standalone executables using zero code changes method of configuration
Is the agent configurable with the IIS server as well? Do i need to have additional configurations in case of applications on IIS -(aspnetcore and asp.net any of them).
Is there a way to configure the application without making changes in the application, Like the way we have it in the aspnet core applications with zero code changes method of configuration.
Regarding you question about configs: the agent will by default read configs through environment variables - the environment variables for each config can be found in the docs. So that should work - have you tried that?
Thankyou for providing me with the link for reference.
I have tried setting up the configuration for my netcore application. However , The application service is not visible in kibana.
I have followed below steps:
Downloaded and unizpped the beta version of the profiler.
Tried setting the environment variable through appcmd.exe via powershell
Below is the screenshot of the same:
Profiler, which currently supports ASP.NET Classic on top of .NET Framework running in IIS with zero code change.
Now, very important: the profiler currently does not support ASP.NET Core running on netcoreapp (or well, it does, but there is a missing feature to automatically start the transaction - we want to cover this later, actually I'm working on this now..) - regardless of where the application runs.
So, from what you write it seems you have an ASP.NET Core application on top of netcoreapp which you run in IIS. Is that correct? If that's the case then the zero code change setup with the startuphook method should work (and not the profiler at this point): .NET Core | APM .NET Agent Reference [1.12] | Elastic.
If that does not work, then we'll need to see what's going on, but probably that'd be the right way to go. Can you maybe collect logs from that setup? There is also a short troubleshooting section here which tells you how to collect logs form the loader: apm-agent-dotnet/src/ElasticApmAgentStartupHook at main · elastic/apm-agent-dotnet · GitHub - just do set ELASTIC_APM_STARTUP_HOOKS_LOGGING=1 - could you please give this a try and see if there is something relevant in those logs?
Thanks a lot for providing such detailed information.
Yes, I was trying to configure ASP.net Core application on IIS. I have tried out with zero code changes that uses startuphook method and its working fine.
Hence moved further checking with IIS.
Also, The link provided for asp.net on can be done in 2 ways
by adding elasticapm in web.config OR
by adding ELASTIC_APM_FULL_FRAMEWORK_CONFIGURATION_READER_TYPE in environment variable.
Any one of the above will do or I'll have to configure both in web.config as well as environment variables.
Please correct my understanding on above.
In that case you can just ignore the IIS related docs we have - you won't really get anything more out of the app by adding it. That doc is specifically for ASP.NET Classic on .NET Full Framework which can only be deployed in IIS - so that's the tech stack which pre-dates ASP.NET Core.
You can run ASP.NET Core apps on IIS as well, but for that setup you won't need our IIS module.
So, what's exactly your goal? If it already works with startuphook, then it should work in IIS and that'd be the preferred way to enable the agent with zero code change for ASP.NET Core in that setup.
Or do I misunderstand something and something does not work for you?
I had tried the startuphook method by declaring the environment variables required in a shell and then triggered it along with the standalone netcoreapp executable.
Today , I declared them in my system's environment variables and deployed the executable in the IIS. That did work
I am able to get the traces now.
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.