blob: b8d9bc734a9bf96b68466b93047f108afacb353a [file] [log] [blame]
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local gauge = grafana.gaugePanel;
local defaults = import '../../../globals/defaults.libsonnet';
gauge.new(
title='CPU Usage',
datasource=defaults.datasource,
)
.addTarget(
target=prometheus.target(
'(rate(proc_cpu_usage{instance="$instance",replica="$replica"}[2m])/proc_cpu_num_cores{instance="$instance",replica="$replica"})*100',
legendFormat=' ',
intervalFactor=1,
instant=true,
),
)
.addThresholds([
{
color: 'green',
value: null
},
{
color: 'orange',
value: 60
},
{
color: 'red',
value: 90
}
])