abrarcv170
abrarcv170

Reputation: 37

automate grafana when an EC2 launched by autoscaling group.instead of repeat option

iam using prometheus and grafana to monitor my Ec2,i have a auto scaling group which creates ec2 when needed,iam trying create a single panel for 'cpu utilisation' which plot cpu utilisation of every instance.when autoscaling group creates an a new instance automaticaly identified by service discovery of prometheus.but how we can plot the details of new instance in same existing graph,i found repeat option which not suitable in my case.i want to plot in same graph.

Upvotes: 0

Views: 1088

Answers (2)

abrarcv170
abrarcv170

Reputation: 37

the repeat option in not suitable in this case ,the solution is that use Prometheus service discovery which will automatically add targets to Prometheus server,and use a custom label there (example:filter ec2 which will start with ASG string and add a label for them)in grafana use this label to filter

Upvotes: 0

rohatgisanat
rohatgisanat

Reputation: 828

The repeat option in not needed in this case. A simple promQL filter selecting only the autoscaling label {label=<autoscaling_group_identifier>} will give cpu_utilization of all the instances in the single query. You can also use the regex-matcher in promQL to easily map to a single graph.

Upvotes: 1

Related Questions