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

How to integrate AppDynamcis APM to monitor .NET Core 2.0 Docker Container Application on Linux?

Prodip.Saha
Producer

Hello AppD Community!

I am trying to integrate my POC app with AppDynamics and it is not working. Don't have clue where to looks for logs which will tell me why! This app is docker build and running on Linux(Ubuntu).

 

Tried to follow the instructions at https://docs.appdynamics.com/display/PRO45/.NET+Core+for+Linux+SDK and https://docs.appdynamics.com/display/PRO45/Using+.NET+Core+for+Linux+SDK but the profiler does not seem to be working. Here is my docker file-

 

FROM microsoft/aspnetcore:2.0
ARG source
WORKDIR /app
ENV ASPNETCORE_URLS=http://+:80

ENV COR_ENABLE_PROFILING="1"
ENV COR_PROFILER="{57e1aa68-2229-41aa-9931-a6e93bbc64d8}"
ENV COR_PROFILER_PATH="/app/runtimes/linux-x64/native/libappdprofiler.so"

EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "gdt.api.demo.dotnetcore.dll"]

 

After i build the container, I run it at the commnad line and application is running fine but nothing appears at AppD controller. I go inside the container to verify if the profiler is at the location specified and it is there.

docker exec -i -t b99c78cae880 /bin/bash

root@b99c78cae880:/app/runtimes/linux-x64/native# ls
libappdprofiler.so

 

I was able to instument AppD with the same .Net Core app but it was deployed in Windows container. I need to monitor the app in Azure Kubernetes where host is Linux. I instrumented AppD machine agents and they are running great in Kubernetes PODs (see attached image) but I can't get to monitor the App!

 

Thanks for taking time to read and comment on my question.

 

 

 

6 REPLIES 6

Prodip.Saha
Producer

I am hoping someone from AppDynamics respond to the thread!

 

Here is what I did to gain more control over OS, Runtimes, etc.-

 

Created my own image to comply with AppD requirement on OS.

Got ubuntu 18.04, installed all the prerequisits and installed dotnetcore runtime following this link

https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x

 

Then, I went to Visual Studio 2017 and updated my dockerfile to use the modified image (ubuntu:prodip). It builds fine and my ASP.NET Core application works like magic! Still AppD instrumentation does not work and I don't see any logs or errors!

 

FROM ubuntu:18.04

# Install required packages

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y unzip && \
apt-get clean


RUN apt-get install -y sudo
RUN apt-get install -y wget
RUN apt-get install -y curl

RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
RUN sudo dpkg -i packages-microsoft-prod.deb

RUN sudo apt-get install apt-transport-https

RUN sudo apt-get update

#RUN sudo apt-get install liblttng-ust0
#RUN sudo apt-get install libcurl3
RUN sudo apt-get install libssl1.0.0
#RUN sudo apt-get install libkrb5-3
#RUN sudo apt-get install zlib1g
RUN sudo apt-get install libicu60

RUN sudo apt-get install libunwind8
RUN sudo apt-get install libuuid1
RUN sudo apt-get update


COPY ./dotnet-install.sh .

RUN sudo ./dotnet-install.sh --channel 2.0 --install-dir ~/cli

ENV PATH="/root/cli:${PATH}"

 

#run this command to build the image

#docker build -t ubuntu:prodip .

 

This is the updated dockerfile used to build the app in Visual Studio:

FROM ubuntu:prodip
ARG source
WORKDIR /app
ENV ASPNETCORE_URLS=http://+:80

ENV COR_ENABLE_PROFILING="1"
ENV COR_PROFILER="{57e1aa68-2229-41aa-9931-a6e93bbc64d8}"
ENV COR_PROFILER_PATH="/app/runtimes/linux-x64/native/libappdprofiler.so"

EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "gdt.api.demo.dotnetcore.dll"]

 

I do bin/bash into the container and here is what I see for OS version metadata:

root@830f31b00d37:/# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@830f31b00d37:/#

 

My ENV variables include AppD stuff. Don't know if PWD and OLDPDW has anything to do with my changes!

COR_PROFILER={57e1aa68-2229-41aa-9931-a6e93bbc64d8}
HOSTNAME=830f31b00d37
COR_ENABLE_PROFILING=1
ASPNETCORE_URLS=http://+:80
COR_PROFILER_PATH=/app/runtimes/linux-x64/native/libappdprofiler.so
PWD=/
HOME=/root
TERM=xterm
SHLVL=1
PATH=/root/cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
OLDPWD=/app/runtimes/linux-x64/native

 

libappdprofiler.so is found in the expected location:

root@830f31b00d37:/# cd /app/runtimes/linux-x64/native
root@830f31b00d37:/app/runtimes/linux-x64/native# ls
libappdprofiler.so
root@830f31b00d37:/app/runtimes/linux-x64/native#

 

AppD- Can you help?

 

Raunak.Mohanty
AppDynamics Team (Retired)
Hi Prodip,

We are reviewing provided info and will get back to you.

Thanks,
Raunak


Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

@Raunak.Mohanty: Thank you for reviewing the thread. Do let me know if you require additional information from me.

Thanks,
Prodip

Hi Prodip, 

 

We have sent direct message to you to share few more details. Please share those details for our review. 

 

Thanks,

Kartikay



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Hi Kartikay,

I responded to your message along with all the supporting information.

 

Thanks,

Prodip

Kartikay,

I am trying to do something similar. I am building some .netcore micro services that will run in the Microsoft Ubuntu Docker image. Most of the instructions I can find talk about how to set it up on a linux server which can be a challenge to do in Docker. I have added the plugin to my project and updated the config file and built the solution without error, but when I try to reference the library with a "using" statement VS cannot find the reference.