Thanks for the help. Will try this.
On Saturday, March 14, 2020 at 5:07:19 PM UTC+5:30, Christian Hoffmann
wrote:
>
> Hi,
>
> On 3/13/20 1:55 PM, Yagyansh S. Kumar wrote:
> > Hi. I am using Number of Cores of a server as the threshold for CPU
> > Load. It is working fine but I want to print the number of cores also in
> > the alert.
> >
> > Configured Alert:
> >
> > - alert: HighCpuLoad
> > expr: (node_load15 > count without (cpu, mode)
> > (node_cpu_seconds_total{mode="system"})) * on(instance)
> > group_left(nodename) node_uname_info
> > for: 5m
> > labels:
> > severity: "CRITICAL"
> > annotations:
> > summary: "CPU load on {{ $labels.instance }} - {{ $labels.nodename
> > }} is more than *number of cores of the machine*."
> > description: "Current Value = {{ $value | humanize }}"
> >
> > Instead of the string "*number of cores of the machine* ", I want to
> > actual number of cores of the server. Is there any way to do this?
>
> Yes, you should be able to query the TSDB using in your summary template
> string.
>
> See this for examples:
>
>
> https://prometheus.io/docs/prometheus/latest/configuration/template_examples/
>
> Kind regards,
> Christian
>
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/501b86c8-512c-4b02-9243-fa13dde5f807%40googlegroups.com.