Prometheus node_exporter promql query to get aggregated daily peak (max) and avg CPU utilisation

Hello all,

I need to obtain a daily aggregation of the avg and max (peak) CPU utilisation per node/instance. I’ve done some research and it seems these are the correct queries:

Avg:

100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle",instance="$node"}[2m])) * 100)

Max:

max_over_time((100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle",ins

Here’s how I defined it in Grafana:

Mostly, I’m looking for confirmation that these are correct and will result in the required data because they do not seem to align with what a different monitoring system (which I do not control produces).

It’s worth noting that I based my queries on the data provided in Promql difference between max and max_over_time

In case you’re familiar with Oracle Enterprise Manager, the query made to generate the report there is:

select target_name, sum(average) CPU_AVE, sum(maximum) CPU_MAX, to_char(ROLLUP_TIMESTAMP,'YYYY-MM-DD HH24:MI') TS_ROLLUP
      FROM SYSMAN.MGMT$METRIC_DAILY
      WHERE ROLLUP_TIMESTAMP > (sysdate -30) and target_name like 'servername'
        and (
                upper(COLUMN_LABEL) like upper('%CPU in User Mode%') or
                upper(COLUMN_LABEL) like upper('%CPU in System Mode %')
            )
    group by target_name,to_char(ROLLUP_TIMESTAMP,'YYYY-MM-DD HH24:MI')
   order by  TS_ROLLUP
;

Thanks in advance for any advice,