PCA (Prometheus Certified Associate) sample exam question with answer 70

Question:
Let a Node Exporter scrape job be denoted by the label job="node". Let there be two static instances for this job, instance="node1" and instance="node2".
Which of the following queries returns a 1 when both nodes are currently being scraped successfully and a 0 otherwise?

  1. min_over_time(up{job="node"})
  2. max(up{job="node"})
  3. min(up{job="node"})
  4. up{job="node",instance="node1"} + up{job="node",instance="node2"}
Answer:
C - is the correct answer. Check aggregation operators.
A - aggregates across time for each individual instance, it does not aggregate across instances.
B - this query returns a 1 as long as at least one of the nodes is being scraped successfully. With this query we could get a result of 1 even if one of the nodes was down.
D - is incorrect as this query returns a 2 if both nodes are being scraped successfully