DX Application Performance Management

Expand all | Collapse all

Can I control the hostname of agents inside a docker container?

Jump to Best Answer
  • 1.  Can I control the hostname of agents inside a docker container?

    Posted 12-11-2018 12:11 AM

    I dont want to see a random hostname each time.  

     

     

     

    #caheadband



  • 2.  Re: Can I control the hostname of agents inside a docker container?
    Best Answer

    Posted 12-11-2018 04:32 AM

    Hi Chris,

    This is Guenter's example of how to configure it

    GitHub - CA-APM/ca-apm-example-docker-tomcat: This example shows how to install a CA APM Java agent in a Tomcat Docker c… 

     

    It mentions being able to control the agent hostname through an environment variable

    Optional: set the environment variable AGENT_HOSTNAME to a persistent hostname (e.g. the container name) that will be used instead of the container id for identifying the CA APM agent.

     

    I'm not sure of anything more clever yet, like being able to actually derive the host it is really running on.

     

    Thanks,

    David



  • 3.  Re: Can I control the hostname of agents inside a docker container?

    Posted 12-11-2018 09:25 AM

    Thanks.

     

    i think I did set ENV HOSTNAME which is docker variable..   Ill try AGENT_HOSTNAME next thanks.



  • 4.  Re: Can I control the hostname of agents inside a docker container?

    Posted 12-11-2018 08:24 PM

    used these both and it didnt work


    ENV AGENT_HOSTNAME="flintstone."
    ENV HOSTNAME="flinststone"

     

    ?



  • 5.  Re: Can I control the hostname of agents inside a docker container?

    Posted 12-12-2018 09:20 AM

    Did you consult with your Docker captain?



  • 6.  Re: Can I control the hostname of agents inside a docker container?

    Posted 12-12-2018 09:21 AM

    Several Times.

     

     

     

     

     

    Chris Milazzo

    APM Technical Consultant

    Architecture & Platform Strategy

    2 Morrissey Boulevard, Boston, MA 02125

    Office 617-474-5466



  • 7.  Re: Can I control the hostname of agents inside a docker container?

    Posted 12-13-2018 06:07 AM

    Hi,


    We set the following attribute in our agent profile:-

     

    introscope.agent.hostName=OSEV3-PROD

     

    Thanks,

    Andrew Marsden



  • 8.  Re: Can I control the hostname of agents inside a docker container?

    Posted 12-13-2018 08:16 PM

    thank you Andrew 

     

    added the following to init_agent.sh which was from Guenters example

     

    sed -i -e "\$aintroscope.agent.hostName=caheadband" $WILY_HOME/core/config/IntroscopeAgent.profile