I am legitimately lost here. I went from Grafana v5.1.3 to v8.3.5. The older version was already in place when I started using it, and alerts were very simple. Most, if not all of my alerts were based on node_load1
, and the usual threshold was 2.0. It would send an alert to Slack with the node_name
, a brief description, and the value. The alert URL itself sent you to the panel of the server that was alerting. There was no template creation.
Now, alerts look horrible since I’m unsure of how to properly create a template.
I decided to try and replicate this type of alert using Integrated Alerts, and the only option is Node High CPU Load
, which is a percentage. I need the value of node_load1
.
So, while in Alert Rule Templates
, I’ve tried to add a very simplistic version just to get something going where I can expand on it later with more details. I am completely new to this.
I tried adding the following to a new Alert Rule Template:
---
templates:
- name: CPU Normalized Load
summary: Load Alert
expr: |-
node_load1{node_name=~".*admin.*", mode!="idle"}
> [[ .threshold ]]
params:
- name: threshold
summary: The value of the normalized load
type: float
range: [0, 3]
value: 2
for: 5m
severity: warning
annotations:
summary: Currently experiencing load issues. ({{ $labels.service_name }})
description: |-
Normalized load for {{ $labels.node_name }} is currently {{ $value }}
However, I get a “Failed to parse rule template” error.
How can I create a simple alert that gives me the node_name, a description, a URL that takes me to the panel in question (in view mode), and that shows the value reported?