PCA (Prometheus Certified Associate) sample exam question with answer 541
Question:
Which of the following is a correct PromQL query to get the total number of nodes that have been down for more than 10 minutes over the last 24 hours?
- count(up == 0)[24h:] > 10m
- count(up == 0)[24h:] > 10m offset 10m
- count(up == 0)[24h:] > bool 10m
- count(up == 0)[24h:] > bool offset 10m
Answer:
B - is the correct answer. To get the total number of nodes that have been down for more than 10 minutes over the last 24 hours, we need to count the number of times the up metric is equal to 0 (which indicates that the node is down) and has been down for more than 10 minutes over the last 24 hours. The [24h:] range vector selector selects data for the last 24 hours, and the offset 10m modifier filters out any data that has been down for less than 10 minutes