mardi 30 juin 2015

Unique Hostname for New Relic's nrsysmond on Elastic Beanstalk

I'm configuring nrsysmond to run on an Elastic Beanstalk container that hosts Generic Docker containers.

Is there any way to get the instance index so that I could combine that with a constant? Something like Production-1, Production-2, etc.

The configuration I'm using looks like this:

packages: 
  yum: 
    newrelic-sysmond: [] 
  rpm: 
    newrelic: http://ift.tt/1h9KgWn 
commands: 
  "01": 
    command: nrsysmond-config --set license_key=`/opt/elasticbeanstalk/bin/get-config environment | jq .NEW_RELIC_LICENSE_KEY | sed -e 's/"//g'`
  "02": 
    command: echo hostname=`/opt/elasticbeanstalk/bin/get-config environment | jq .RAILS_ENV | sed -e 's/"//g'` >> /etc/newrelic/nrsysmond.cfg 
  "03": 
    command: usermod -a -G docker newrelic
  "04": 
    command: /etc/init.d/newrelic-sysmond restart

This works great, but sets all the hostnames to the same thing. I don't want to use the Elastic Beanstalk hostname, as those change every time the instances scale. This clogs up New Relic with dead instances.

This is on 64bit Amazon Linux 2015.03 v1.4.3 running Docker 1.6.2




Aucun commentaire:

Enregistrer un commentaire