Installing node_exproter on all EC2 instances automatically

21 views
Skip to first unread message

kiran

unread,
Aug 18, 2020, 11:49:18 PM8/18/20
to Prometheus Users
Hello all,

I am looking for a way to 
1. install node_exporter automatically on all EC2 instances on AWS 
2. Handle auto-scaling, newly added instances and deleted instances.
3. Looking for a simple bash script and NOT through configuration tools(like ansible).

From what I understood, EC2 service discovery helps with identifying newly added instances, but it expects node_exporter to be installed already on the target/s. I am looking for a way where it helps with node_exporter installation automatically(I know EC2 userdata section can be used but that's one instance at a time and is manual and applicable for new instances) as well.

Anyone has a bash script that one could share that will be great. 

Brian Candler

unread,
Aug 19, 2020, 3:52:09 AM8/19/20
to Prometheus Users
On Wednesday, 19 August 2020 04:49:18 UTC+1, kiran wrote:
From what I understood, EC2 service discovery helps with identifying newly added instances, but it expects node_exporter to be installed already on the target/s.

I don't believe that's true.  Can you point to something you've read which suggests that is the case?

EC2 service discovery makes queries to the EC2 API to learn the set of instances.  It does not talk to the instances themselves.  See:
 
I am looking for a way where it helps with node_exporter installation automatically

That's a separate question, and there are lots of ways to do that.  cloud_init is one.  Making your own AMI with node_exporter included is another.  Tools like ansible are another.  Making a tarball and untarring it over ssh is another.  Just use whatever mechanism you are already using to configure your EC2 instances after creating them.

I don't think that questions about how to administer EC2 instances in general are on-topic for the prometheus-users group.
Reply all
Reply to author
Forward
0 new messages