Same bugs on Lab - Operators, Vector Matching, Aggregators

I found same bugs on lab “Lab - Operators, Vector Matching, Aggregators”.

All exercices that neet same metric from instance loadbalancer isn`t scraped to prometheus.

exercice 7: the best way to count all cpu from the istance is:
count(sum(node_cpu_seconds_total{}) by (cpu))

but the check show wrong for me.

Hi,

Please share the lab link, I’ll check it.

https://learn.kodekloud.com/user/courses/prometheus-certified-associate-pca/module/b4de09eb-de60-4a9d-a193-b6f74f9889a3/lesson/0a0d5663-1e6c-4108-b228-b49fbe9d02ab

Hi,

The issue is that your query isn’t filtering by the specific instance (loadbalancer:9100).

The correct query is:

count(node_cpu_seconds_total{instance="loadbalancer:9100", mode="idle"})

This ensures you count only the CPUs for the loadbalancer:9100 instance. Save it in /root/query7.txt, and the check should work.

Sorry, I think that I don`t all details for you. We have multiple problems, follow below:

  1. All exercices that neet same metric from instance loadbalancer isn`t scraped to prometheus.

  2. the best way to count all cpu from the istance is:
    count(sum(node_cpu_seconds_total{instance=“loadbalancer:9100”}) by (cpu))

I dont need specify label mode to count total number of cpus. But the main problem is that metrics from loadbalancer instance werent scraped to prometheus.

let me show you more details: