Adding APM Insight .NET agent in Kubernetes via InitContainers
The below steps will guide you through the process of integrating the APM Insight .NET agent into your Kubernetes deployment using init containers.
Create a secret for the Applications Manager Apminsight license key in your application namespace
- kubectl create secret generic s247licensekey --fromliteral=S247_LICENSE_KEY=YOUR_LICENSE_KEY_HERE
Note:
Replace YOUR_LICENSE_KEY_HERE with the appropriate apminsight license key value from the Applications Manager console.
Create an empty volume mount that will be used to copy the agent files during the InitContainers process.
Example:
-
volumeMounts:
-
- name: s247dotnetcoreagent
Include the following InitContainers command and mount the volume in both initContainer and your application container in your helm chart/deployment YAML file:
-
kind: Deployment
-
spec:
-
containers:
-
- name: dotnet-app
-
image: microsoft/dotnet-samples:aspnetapp
-
volumeMounts:
-
- mountPath: /home/APMDotNetAgent
-
name: s247dotnetcoreagent
-
initContainers:
-
- name: init-site24x7-agent
-
image: site24x7/apminsight-dotnetagent:latest
-
command: ['cp', '-r', '/opt/site24x7/APMDotNetAgent', '/home']
-
volumeMounts:
-
- name: s247dotnetcoreagent
-
mountPath: /home/APMDotNetAgent
Add the following environment variables to application containers.
-
spec:
-
containers:
-
- name: dotnet-app
-
env:
-
- name: S247_LICENSE_KEY
-
valueFrom:
-
secretKeyRef:
-
name: s247licensekey
-
key: S247_LICENSE_KEY
-
- name: CORECLR_ENABLE_PROFILING
-
value: "1"
-
- name: CORECLR_PROFILER
-
value: "{9D363A5F-ED5F-4AAC-B456-75AFFA6AA0C8}"
-
- name: DOTNETCOREAGENT_HOME
-
value: "/home/APMDotNetAgent"
-
- name: CORECLR_PROFILER_PATH_64
-
value: "/home/APMDotNetAgent/x64/libClrProfilerAgent.so"
-
- name: CORECLR_PROFILER_PATH_32
-
value: "/home/APMDotNetAgent/x86/libClrProfilerAgent.so"
-
- name: DOTNET_STARTUP_HOOKS
-
value: "/home/APMDotNetAgent/netstandard2.0/DotNetAgent.Loader.dll"
-
- name: MANAGEENGINE_COMMUNICATION_MODE
-
value: "direct"
-
- name: SITE24X7_APP_NAME
-
value: "YOUR_APM_APPLICATION_NAME"
-
- name: APMINSIGHT_HOST
-
value: "APPLICATIONS_MANAGER_URL"
Note:
Replace your application name with YOUR_APM_APPLICATION_NAME value, and apm url with APPLICATIONS_MANAGER_URL.
New to ADSelfService Plus?
Related Articles
How to add an APM Insight Python agent in Kubernetes via InitContainers?
Adding the APM Insight Python agent via init containers in Kubernetes enables the seamless integration of performance monitoring for Python applications, ensuring efficient tracking and analysis of application behavior within the Kubernetes ...
How to add an APM Insight Node.js agent in Kubernetes via InitContainers?
To integrate the APM Insight Node.js agent into your Kubernetes applications using InitContainers, follow the steps given below: Step 1: Create an empty volume that will be used to copy the agent files during the initContainers process. Example: ...
Adding APM Insight Java agent in a Kubernetes environment
There are three methods for installing the APM Insight Java agent in a Kubernetes environment: Using Dockerfile Using InitContainers Using Persistent Volumes Prerequisites Download the latest APM Insight Java agent ZIP file. Extract the ZIP file and ...
How to add an APM Insight Java agent in Kubernetes via InitContainers?
Step 1. Create a secret to access the APM Insight license key in your application namespace: kubectl create secret generic app-secret --from-literal=s247licensekey='your_APMInsight_license_key' -n petclinic The license key can be obtained from the ...
Uninstrumented Block of Code - APM Insight
In the traces tab --> Slowest Method Calls and Count we show if you find Un-instrumented block of code the reason is as follows: Basically, What is un-instrumented block of code in APM Insight? By default, APM Insight agent monitors known frameworks ...