Prometheus monitoring Show maximum number of nodes allowed in a node group AWS EKS

0 votes

i'm trying to show in grafana the max number of nodes that is set in the node group, to contrast with current number of nodes (and eventually make an alert)

What i have is current number of nodes:

sum(up{instance=~".*.myregion.compute.internal", eks_amazonaws_com_nodegroup="mygroup"})

Any tips? Thanks!

I tried different queries, with no result. I have no idea what query would work here.

Feb 16, 2023 in AWS by sarit
• 1,830 points
643 views

1 answer to this question.

0 votes

You can use the Prometheus eks_nodegroup_capacity metric to get the maximum number of nodes that is set in the node group.

The eks_nodegroup_capacity metric provides the number of nodes that a node group is capable of hosting. You can use the max function to get the maximum value of this metric over time. Here's an example query to get the maximum capacity of a node group named mygroup:

max(eks_nodegroup_capacity{nodegroup_name="mygroup"})

You can combine this with your current query to get the current number of nodes and calculate the difference to set an alert when the number of nodes exceeds the maximum capacity.

For example, if you want to set an alert when the number of nodes exceeds 90% of the maximum capacity, you can use the following query:

sum(up{instance=~".*.myregion.compute.internal", eks_amazonaws_com_nodegroup="mygroup"}) > 0.9 * max(eks_nodegroup_capacity{nodegroup_name="mygroup"})

This query will return a boolean value that is true when the number of nodes exceeds 90% of the maximum capacity, and false otherwise. You can use this query as the condition for your alert rule in Grafana.

Ready to level up your coding game? Uncover the realm of microservices with our cutting-edge Microservices Developer Certification!

answered Feb 17, 2023 by anonymous

Related Questions In AWS

0 votes
1 answer

if instance is a part of some AutoScaling Group in AWS or not ?

You can run this command below on ...READ MORE

answered Jun 2, 2018 in AWS by Cloud gunner
• 4,670 points
1,458 views
0 votes
1 answer

What is the maximum storage capacity of a node in Redshift?

You can create a cluster using either ...READ MORE

answered Oct 26, 2018 in AWS by Archana
• 5,640 points
1,712 views
0 votes
1 answer
0 votes
1 answer

How to add Node Exporter in Prometheus server?

Hi@akhtar, To add Node Exporter in Prometheus server, you have to ...READ MORE

answered May 28, 2020 in DevOps & Agile by MD
• 95,440 points
2,287 views
0 votes
1 answer

How to install grafana tool in Linux?

Hi@akhtar, To download Grafana in Linux system, you ...READ MORE

answered May 29, 2020 in DevOps & Agile by MD
• 95,440 points
847 views
+1 vote
2 answers
0 votes
1 answer

alert manager not working properly in prometheus

This is the default functionality of the ...READ MORE

answered Apr 10, 2018 in DevOps & Agile by DareDev
• 6,890 points
1,240 views
0 votes
1 answer

Pass account id of an AWS sub account using a variable as an argument in CloudWatch Alarm Actions with python (boto3)?

Python String and Integer concatenation >>> print("arn:aws:swf:us-east-2:{0}:action/actions/AWS_EC2.InstanceId.Stop/1.0".format(acccnum)) arn:aws:swf:us-east-2:12312312312312:action/actions/AWS_EC2.InstanceId.Stop/1.0 >>> print("arn:aws:swf:us-east-2:" ...READ MORE

answered Oct 5, 2018 in AWS by Priyaj
• 58,090 points
1,376 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP