cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with .NET Core Microservices Agent for Windows

Robert.Ford
Producer

I am running into an issue when working with the .NET Core Microservices Agent for Windows agent.  I have a sample webapi that I wrote that just has a couple of basic controllers in it.  I am trying to follow the instructions listed in the below URL.

 

https://docs.appdynamics.com/display/PRO45/Install+the+.NET+Core+Microservices+Agent+for+Windows

 

I am able to install the nuget package identified, I was able to configure the config file and I can launch the application and see it added to the AppD dashboard.  What I cannot do is add the reference "using AppDynamics" to any of my classes so that I can define a business transaction in my controllers.  When I try to add it, intellisense cannot find the package and if I add it manually, I get a "missing namespace" error when I try to build the project.

 

Am I missing something in the setup?  I know it is at least partially setup correctly or else I would not be able to the app in the Applications list on the website.  Any guidance would be appreciated.

 

Thanks,

12 REPLIES 12

Gabriel,

 

I have discovered some of the causes of the issues I have been having and am now able to get the client to see the namespace for my "using" statements.  There are some issues with a couple of the config files that the nuget process creates/modifies.  It is also interesting to note, that their solutions assume that if you are running code in a linux environment that you are also developing on a linux environment.  Their nuget backages are OS dependent.  I have been playing with them a bit since I develop in Windows and Deploy to Linux containers.  You would think that since they support dotnet core that their packages would also be cross platform, but currently they are not.  I think that I might have something that will work for me though I have one last issue I am trying to figure out.  AppDynamic's documentation has not been helpful in the least in resolving these issues, so I have been having to hack around to figure things out.

 

What is your enviornment that you are working in?  Are you deploying to Windows containers or Linux containers?  I would be more than willing to share my experiences if it helps someone else.

Robert,

 

I'm developing in a windows environment and my application is running in a linux container. Actually, I achieved the instrumentation following the steps posted in this thread by @Kartikay.Tripathi. I only needed to modify a little bit the dockerfile because my application is installed with a framework-dependent way. Now the only issue that I'm facing is the fact that I need to set up the node-name dinamically according to the container hostname, but I found out that there is some environment variables that are capable of doing that.

This is the dockerfile that I'm using:

 

FROM microsoft/dotnet:2.0-sdk

COPY . .

RUN dotnet restore

WORKDIR /MyApplication

RUN dotnet build -c Release -o /app
RUN dotnet publish -c Release -o /app

WORKDIR /app

EXPOSE 80/tcp
ENV ASPNETCORE_URLS http://*:80

ENTRYPOINT ["dotnet", "MyApplication.dll"]

I'm also using docker-compose to deploy my containers so there is my docker-compose.yml file:

 

version: '2'
services:
  my-application:
    environment:
      - CORECLR_PROFILER={57e1aa68-2229-41aa-9931-a6e93bbc64d8}
      - CORECLR_ENABLE_PROFILING=1
      - CORECLR_PROFILER_PATH=/app/runtimes/linux-x64/native/libappdprofiler.so
    image: my-application
    build: .
    ports: 
      - "8086:5000"

You can notice that the CORECLR_PROFILER_PATH is the one generated after the 'dotnet publish' command. I searched for it inside of the container using the 'find' command and this was the path that I found.

 

Also, I didn't got some problems installing the AppDynamics nuget package directly from nuget.org, using the VS package manager. The name of the package is AppDynamics.AgentSDK v4.5.2.

 

Finally, those are the environment variables that can be used to treat the node-name point:

 

APPDYNAMICS_AGENT_NODE_NAME = <name>

APPDYNAMICS_AGENT_REUSE_NODE_NAME = (true | false)

APPDYNAMICS_AGENT_REUSE_NODE_NAME_PREFIX = <prefix>

 

@Kartikay.Tripathi is there any guide where we can check all of the environment variables that are available to use?

 

Hope it helps,

Gabriel

Gabriel,

 

Thanks for the response.  I was using v4.5.1.  They must have fixed some of the glitches with the v4.5.2 version.  I will try playing with that when I get a spare moment.  The issue you mentioned about dynamic naming is something I was trying to solve as well.  I wrote some code, which may not be the best way to do this, to read in the AppD config file that is generated then get the container host name and a few other values and update the node name then write that data back to the config file.  I am running this code in startup and it seems to be running decently well.  What I want to be able to do is control those values via environment variables so that I have complete control over what shows up in AppD.  If you are interested in what I put together, let me know.

 

With the v4.5.1 version the issue with the "so" file was that the nuget setup was not automatically adding the file to the project but was adding it to the generic nuget path (something like /root/.nuget/...) and the app was having a hard time finding that path.  Even though I put the same path that showed up using the "find" linux command it was not working.  I will try what you provided to see if that resolved my issue.  I am hopeful.

 

Thanks,