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
11-22-2019
10:09 AM
- last edited on
01-30-2023
09:45 AM
by
Claudia.Landiva
Overview
Dockerfile snippet
How to use the Dockerfile
Special instructions for Alpine users
AppDynamics .NET Agent for Linux supports monitoring .NET Core 2.x and 3.0 applications, and it is becoming more and more popular with customers who use containers to run their applications.
There are several ways to deploy the agent after you download it from https://download.appdynamics.com/. You can include agent files in the Docker file, load them from a sidecar container or share them on a separate volume.
Even though there’s this flexibility of use, we’ve been looking at options to simplify the agent deployment and configuration!
The idea that drove this effort is simple:
Here is the snippet of a Dockerfile that does all that!
# Download AppDynamics agent during multi-stage docker build
# Insert this portion at the top of your Dockerfile
FROM mcr.microsoft.com/powershell as APPDTOOL
WORKDIR /agent
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# !!!Important: Replace user name and password with proper identify at accounts.appdynamics.com
RUN $user = "<user name for AppDynamics account>"; \
$pwd = "<password for AppDynamics account>"; \
$request = [string]::Format("{{""username"": ""{0}"",""password"": ""{1}"",""scopes"": [""download""]}}", $user, $pwd); \
$token = Invoke-WebRequest -Method POST -Body $request -Uri https://identity.msrv.saas.appdynamics.com/v2.0/oauth/token | ConvertFrom-Json; \
$agents = Invoke-WebRequest -Uri https://download.appdynamics.com/download/downloadfilelatest/ | ConvertFrom-Json; \
$agent = $agents | where { $_.filetype -eq "dotnet-core" -and $_.os -eq "linux" }; \
Invoke-WebRequest -Authentication Bearer -Token (ConvertTo-SecureString -AsPlainText -Force $token.access_token) -Uri $agent.download_path -OutFile agent.zip; \
Expand-Archive ./agent.zip ./files
# Your existing Dockerfile logic needs to be put in here
# ==== BEGIN ===
# ===== END ====
# Insert this line at the end of your existing Dockerfile to copy agent files to an application container
COPY --from=APPDTOOL /agent/files /opt/appdynamics/dotnet
# Mandatory settings required to enable the agent for .NET Core application
ENV CORECLR_PROFILER={57e1aa68-2229-41aa-9931-a6e93bbc64d8} \
CORECLR_ENABLE_PROFILING=1 \
CORECLR_PROFILER_PATH=/opt/appdynamics/dotnet/libappdprofiler.so
# Configure connection to the AppDynamics controller
ENV APPDYNAMICS_CONTROLLER_HOST_NAME=controller.saas.appdynamics.com
ENV APPDYNAMICS_CONTROLLER_PORT=443
ENV APPDYNAMICS_CONTROLLER_SSL_ENABLED=true
ENV APPDYNAMICS_AGENT_ACCOUNT_NAME=account-name
ENV APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY="access-key"
# Configure application identity in AppDynamics
ENV APPDYNAMICS_AGENT_APPLICATION_NAME="My Application"
ENV APPDYNAMICS_AGENT_TIER_NAME="Sample Tier"
ENV APPDYNAMICS_AGENT_REUSE_NODE_NAME=true
ENV APPDYNAMICS_AGENT_REUSE_NODE_NAME_PREFIX="Instance"
"alpine-linux"
In the script to get correct agent binaries.ENV LD_LIBRARY_PATH=/opt/appdynamics/dotnet
This is the first version of this Dockerfile — I’m looking to mature it over time.
So, please, share your feedback, suggestions, and issues with me!
Regards,
-Alex
03-30-2020 01:11 PM - edited 11-13-2020 11:56 AM
Hello AppD Community,
We are still looking for feedback. If you have any, please do reply to this post with your experience. Provide as much detail and context as you can.
Thanks for your time and contributions.
Thanks,
Ryan, Cisco AppDynamics Community Manager
Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Check out Observabiity in Action
new deep dive videos weekly in the Knowledge Base.
01-27-2023 10:51 AM
Thank you for this, it got me started. I do get the following error:
appd.agent.profiler(Info): Not able to find config from path /opt/appdynamics/dotnet/AppDynamicsConfig.json
So I'm guessing I have to create a config file
02-06-2023 10:50 PM
Hi, @Jesse.Prescott – Did you have any luck after creating the config file?
02-07-2023 08:25 AM
Well I don't get that error anymore. Looking at the logs, I don't see any errors. But also not seeing any data in my AppD dashboard, so it doesn't appear to be working. But it could just be my configuration. I'm new to all of this.
03-10-2023 09:09 AM
Hi @Jesse.Prescott,
At this point, I would recommend contacting Support at this time for more help.
Thanks,
Ryan, Cisco AppDynamics Community Manager
Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Check out Observabiity in Action
new deep dive videos weekly in the Knowledge Base.
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form