Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
on
10-09-2018
11:49 AM
- edited on
08-10-2021
10:44 AM
by
Claudia.Landiva
This article is under revision to include the latest released .NET Core frameworks.
Want to be notified when the revision is live? Click the 3-dot menu upper right, then Subscribe
You can follow the steps in this article if your .NET Core-based application is already running on a production environment or any other environment on Windows where you are targeting to instrument the application, but you don’t have the flexibility of recompiling the application after installing the NuGet package. In spite of that, you want to instrument your running application with the AppDynamics Microservices Agent. In this scenario, you only need to deploy the required DLLs and configuration directly into the production environment or any other environment where you are targeting to instrument the application.
If you need to install the NuGet package into your .NET project with the assistance of Visual Studio before deploying it into the production environment or any other environment for instrumentation, follow the steps outlined in Install the .NET Core Microservices Agent for Windows instead. The steps below would not apply to you.
As mentioned above, these steps are intended for customers who are running .NET Core 2.0+ based applications hosted on a Windows environment.
Before you instrument the application, make sure you have access to the AppDynamics Controller in which your application metrics will appear. Refer the Agent and Controller Compatibility document to ensure your Controller version is compatible with your agent version.
*.AppDynamicsConfig.json
file as shown below.{
"controller": {
"host": "example_demo.saas.appdynamics.com",
"port": 80,
"account": "account_name",
"password": "password",
"ssl": false,
"enable_tls12": false
},
"application": {
"name": "Application_Name",
"tier": "Tier_Name",
"node": "Node_Name"
}
}
AppDynamicsAgentLog.config
to add the specific path to Agent Logs.<target name="logfile" xsi:type="File" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="${environment:variable=PROGRAMDATA}\AppDynamics\DotNetAgent\Logs\AgentLog.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}" />
<target name="logfile" xsi:type="File" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="C:\APPDYNAMICS_Logs\AppDynamics\DotNetAgent\Logs\AgentLog.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}" />
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={39AEABC1-56A5-405F-B8E7-C3668490DB4A}
CORECLR_PROFILER_PATH_32=<actual_path>\AppDynamics.Profiler_x86.dll
CORECLR_PROFILER_PATH_64=<actual_path>\AppDynamics.Profiler_x64.dll
Where <actual_path> is the complete path to the AppDynamics.Profiler dll.
Web.config
file so it will get the value during the runtime.<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\TestNetCoreApplication.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
<environmentVariables>
<environmentVariable name="CORECLR_ENABLE_PROFILING" value="1" />
<environmentVariable name="CORECLR_PROFILER" value="{39AEABC1-56A5-405F-B8E7-C3668490DB4A}" />
<environmentVariable name="CORECLR_PROFILER_PATH_64" value=".\AppDynamics.Profiler_x64.dll" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>
<!--ProjectGuid: 99ed82fd-f96d-48bc-92f7-7615a67d89a8-->
where is the location of the AppDynamics core agent profiler ?
AppDynamics.Profiler_x64.dll and AppDynamics.Profiler_x86.dll are the profiler dlls, which you place in the common folder location or application folder to instrument the .NET Core based applications.
Also, it can be the anywhere only thing you just need to set the path in the following environment variables "CORECLR_PROFILER_PATH_64" or "CORECLR_PROFILER_PATH_32"
For rexamplee -
<environmentVariable name="CORECLR_PROFILER_PATH_64" value=".\AppDynamics.Profiler_x64.dll" />
for example :
<environmentVariables>
<environmentVariable name="CORECLR_ENABLE_PROFILING" value="1" />
<environmentVariable name="CORECLR_PROFILER" value="{39AEABC1-56A5-405F-B8E7-C3668490DB4A}" />
<environmentVariable name="CORECLR_PROFILER_PATH_64" value="D:\Websites\staging\FINACPI_OPTEST\AppDynamics.Profiler_x64" />
<environmentVariable name="CORECLR_PROFILER_PATH_86" value="D:\Websites\staging\FINACPI_OPTEST\AppDynamics.Profiler_x86" />
</environmentVariables>
<environmentVariables />
Yes, It looks correct.
FYI - If the configured location "D:\Websites\staging\FINACPI_OPTEST", is not your project location, kindly give the full access to the user identity under which your application is running/application pool is configured.
What about for a .NET Core console application? There's no web.config in a console app to set the environment variables. Where should I be setting the environment variables in that scenario?
Hi Harrison,
You can add these Environment variables at the system level. Let me know if you have any questions for this.
Hi,
We tried instrumenting this today but it did not work. It only started working when we changed the name of Config file to AppDynamicsConfig.json instead of <APP>.AppDynamicsConfig.json.
For example,
We see only one line below in profiler logs with App.AppDynamicsConfig.json and we don’t see the agent reporting.
2020-04-22 13:18:45.444095[0x00001cc4]<info>:Use CoreCLR profiler
However, when we change the config file name to AppDynamicsConfig.json, it reads successfully and starts reporting and we see logs growing.
2020-04-22 13:24:20.859515[0x000045d4]<info>:Use CoreCLR profiler
2020-04-22 13:24:20.861510[0x000045d4]<info>:Should instrument standalone profiler process (config found at C:\inetpub\wwwroot\<APP Path>\AppDynamicsConfig.json): w3wp as app w3wp.exe
2020-04-22 13:24:20.862518[0x000045d4]<info>:Successfully read file.
We are using 4.5.18.1 version of the .Net core microservice agent.
Although it is working, the problem we have is whenever we deploy the application, it automatically changes the name of the config to <APP>.AppDynamicsConfig.json and we have to change it back again.
Any recommendation around that?
Regards,
Chetan
@Chetan.Goyal — I spoke with @Ashish.Singh and he had a couple of suggestions to relate.
If it is working with AppDynamicsConfig.json
and not <APP>.AppDynamicsConfig.json
, it seems you might be using .NET Core Framework 2.2 or above, for which this is expected behavior.
You mentioned that it is re-converting to <APP>.AppDynamicsConfig.json
after deployment. you might look at which NuGet package and version you're are using as this reconversion after deployment should not occur with the latest NuGet version.
If this doesn't help, @Ashish.Singh recommends you open a Support ticket so the issue can be further investigated by the correct team.
Claudia Landivar
Community Manager & Editor
Hi @Ashish.Singh,@Claudia.Landivar /Appdynamics team,
I have followed the steps that are mentioned in this article to instrument .net core application with app dynamics .net core microservices.
I can able to load the profiler with "AppDynamicsConfig.json" not <APP>.AppDynamicsConfig.json.
But I can't able to get the metrics, transactions, and node details on the controller side.
Note: I can able to get the transactions on the controller side for .net applications.
Here are the below agent.log details, Please help me in solving the issue earliest.
Info ConfigurationChannel Sending Registration request with: Application Name ***, Tier Name GlobeEx, Node Name ****, Host Name **** Node Unique Local ID ***, Version 21.5.1 compatible with 4.4.1.0
2021-08-02 18:53:13.6107 17712 ******1 67 Warn ConfigurationChannel Could not connect to the controller/invalid response from controller, cannot get initialization information, controller host [******.saas.appdynamics.com], port[***], exception [System.Exception: Connection back off limitation in effect: https://****************.saas.appdynamics.com:***/controller/instance/0/applicationConfiguration_PB_]
2021-08-02 18:53:13.6107 17712 *********1 67 Error ConfigurationChannel Exception: Connection back off limitation in effect: https://**********.saas.appdynamics.com:****/controller/instance/0/applicationConfiguration_PB_ Exception: System.Exception: Connection back off limitation in effect: https://********.saas.appdynamics.com:****/controller/instance/0/applicationConfiguration_PB_
Warn ConfigurationChannel Could not connect to the controller/invalid response from controller, cannot get initialization information, controller host [******.saas.appdynamics.com], port[****], exception [System.Exception: Failed to execute request to endpoint [https://******.saas.appdynamics.com:**/controller/instance/0/applicationConfiguration_PB_]. For more details if needed please set trace level for logger [com.appdynamics.REST.RESTProtobufCommunicator]
---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
Hi kinley.jasser,
Based on the shared error message as below -
Warn ConfigurationChannel Could not connect to the controller/invalid response from controller, cannot get initialization information, controller host [******.saas.appdynamics.com], port[****], exception [System.Exception: Failed to execute request to endpoint [https://******.saas.appdynamics.com:**/controller/instance/0/applicationConfiguration_PB_]. For more details if needed please set trace level for logger [com.appdynamics.REST.RESTProtobufCommunicator]
---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
It seems like any one of the credentials or Controller details that you have entered while connecting the Agent to the Controller is not correct.
Could you please re-validate the Controller HOST, Account Name, Account Access Key, etc, and then check if it helps?
Thanks,
Ashish.
edited for clarity | Claudia Landivar, Community Manager
Thanks for the update, @Ashish.Singh!
@kinley.jasser, we look forward to learning whether Ashish's suggestion helped resolve this issue. Please post and let us know your experience!
Hello,
I have a .NET 5 WebApi
I've installed, the AppDynamics.Agent.Windows package following the instructions.
It seems to be picking the profiler dlls but I get a single log with the following message:
[0x000034e0]<info>:Use CoreCLR profiler.
Any help you can give me is welcome. Thanks in advance!
@Maximiliano.Guillen - Starting with .Net msi agent version 20.3.x, the .NET Agent MSI installer for Windows now includes support for .NET Core applications, enabling unified management of .Net Core and full framework applications on Windows. The agent monitors .NET Core applications for IIS out of the box, if automatic IIS mode is configured. So we would recommend to install the latest 21.x agent and validate the behavior.
config.xml
file, just as you would configure .NET framework applications. You have to manually configure .NET Core applications in the config.xml
file in either of the following scenarios:
dotnet.exe
So can you remove the Micro Services agent related configuration and try instrumenting with latest MSI agent available on download.appdynamics.com for the respective .net core sites. Make sure to configure the sites manually in config.xml and provide same tier and node names so that it should start reporting under the same node. Also make sure at system level CORECLR_PROFILER is needed to be set to "AppDynamics.AgentProfiler" for msi agent to instrument the .net core applications.
Please restart Appdynamics Coordinator Service and following that please restart IIS and apply fresh load on the applications and let us know the behavior ?
Let us know if you still face any issues.
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form