Agent naming for multiple instances of same app

363 views
Skip to first unread message

Pavani Manthana

unread,
Sep 18, 2019, 6:55:50 PM9/18/19
to Glowroot
Hi Trask - We are trying to implement glowroot agent for an app that has multiple instances of the app running on a node and needs to use the same glowroot.jar. So we did setup the glowroot.properties with multi.dir=true and passing agent.id=XXX-XXX-XXX::. We noticed that you have logic in the code that adds the nodename to the agentid in this case since it only has rollup name nad not agent name which works very well. So agent id that it now uses is something line 'XXX-XXX-XXX::<machinename>'. However when there are multiple instances the dir creation under the glowroot folder for agent seems to be complaining about a lock exception since the agent.id is not unique. 

Error Message

2019-09-18 13:45:01.037 ERROR org.glowroot - Glowroot failed to start, directory in use by another jvm process: /opt/app/aft/hfrapm/glowroot/agent-XXX-XXX-Service-- (unable to obtain lock on /opt/app/aft/hfrapm/glowroot/agent-XXX-XXX-Service--/tmp/.lock). If you are trying to monitor multiple JVM processes on one box from the same agent installation, please see instructions for how to do this on the wiki: https://github.com/glowroot/glowroot/wiki/Agent-Installation-(with-Embedded-Collector)#monitoring-multiple-jvm-processes-on-one-box
 

I noticed also that the glowroot-agent-core-unshaded.Diretories class also has some logic to take a number range in the agent_id and creates sub directories appropriately for each agent. However it does not send the number from range in the agent.id when it connects to the collector. 

Any advise on how we can name the agent.id so that it is unique for multiple instances of an app and note that I cannot change the jvm args agent.id for each instance. Agent should be able to generate a randome number of provided number from range and be able to connect to the collector.

Thanks,
Pavani

Ben M.

unread,
Jan 29, 2021, 3:27:29 PM1/29/21
to Glowroot
Hi Pavani,


I think such a naming should be generated by your deployment.
You are right that you will need to set `-Dglowroot.agent.id=.` from your deployment strategy.


- Ben
Reply all
Reply to author
Forward
0 new messages