Splunk AppDynamics

Utilizing Dynamic Java Agent Node Name in Cluster Agent

Daniel_Howell1
New Member

We've had good success auto-instrumenting an all-java kubernetes application with the cluster agent, but require the ability to use a custom APPDYNAMICS_AGENT_NODE_NAME. During manual instrumentation, this property can be set as an ENV in the container the java agent is attaching to, but it's not clear from the documentation the way to do this from the cluster agent config. 


https://docs.appdynamics.com/21.4/en/infrastructure-visibility/monitor-kubernetes-with-the-cluster-a...

I am utilizing the latest cluster agent operator and cluster agent, with a cluster-agent.yaml as follows:

```

apiVersion: appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
name: k8s-cluster-agent
namespace: appdynamics
spec:
appName: "demo"
controllerUrl: "http://xxx.com:80"
account: "xxx"
logLevel: "DEBUG"
# docker image info
image: "docker.io/appdynamics/cluster-agent:latest"
serviceAccountName: appdynamics-cluster-agent
nsToMonitor: [demo]
instrumentationMethod: Env
nsToInstrumentRegex: demo
appNameStrategy: manual
defaultAppName: demo
#defaultCustomConfig: "-Dappdynamics.agent.nodeName=manual-test"
defaultEnv: JAVA_TOOL_OPTIONS
resourcesToInstrument: [ Deployment, StatefulSet ]
instrumentationRules:
- namespaceRegex: demo
language: java
appName: demo
# customAgentConfig: -Dappdynamics.agent.nodeName="manual-test"
# customAgentConfig: -Dappdynamics.agent.nodeName=${APPDYNAMICS_AGENT_NODE_NAME}
customAgentConfig: APPDYNAMICS_AGENT_NODE_NAME="manual-test"
imageInfo:
image: docker.io/appdynamics/java-agent:20.3.0
agentMountPath: /opt/appdynamics

 
With all 3 variations of the customAgentConfig above and  an APPDYNAMICS_AGENT_NODE_NAME in the target deployment set. Any help would be much appreciated

Labels (1)
0 Karma

iamryan
Community Manager
Community Manager

Hi @Marcie.Sirbaugh,

Thanks for following up and sharing your solution! I love to see it. 

0 Karma

Marcie_Sirbaugh
Path Finder

This ended up working for me, I add the below to my CA yaml.

customAgentConfig: 
 -Dappdynamics.agent.reuse.nodeName=true
 -Dappdynamics.agent.reuse.nodeName.prefix=$(APP_NAME)

Marcie_Sirbaugh
Path Finder

Also looking for a solution to this and for using a variable with:

customAgentConfig: -Dappdynamics.agent.reuse.nodename.prefix=$name

I can set this to a specific name, but would like for the microservice name to be picked up instead so I can have one entry in my yaml config.

0 Karma

Michael_Norman1
New Member
Did you ever figure this out? I have a similar situation.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...