Prometheus: Should alerting rules names really be valid metric names ?

Created on 3 Apr 2020  路  2Comments  路  Source: prometheus/prometheus

Hi, on the documentation page about Recording rules, it's mentioned that :

The names of recording and alerting rules must be valid metric names

... meaning that it should match the regex [a-zA-Z_:][a-zA-Z0-9_:]*.

However, in my own configuration, I've used spaces in my alert names like Daily Peak and it's working just fine. Indeed, alert names end up as a label value (allowing any Unicode Character) as in ALERTS{alertname="Daily peak"} and not as a metric or label name (constrained to an ascii regex).

So I'm wondering if alerting rules names should really be valid metric names ?
If not I'll make the pull request to add clarification on this subject.

Thx for this piece of software :wink:

componendocumentation componenrules kinbug low hanging fruit

Most helpful comment

So either this is a regression and needs to be fixed, or it could be that this has been around so long that we might have to make it the official behaviour.

All 2 comments

So either this is a regression and needs to be fixed, or it could be that this has been around so long that we might have to make it the official behaviour.

On 03 Apr 01:31, Brian Brazil wrote:

So either this is a regression and needs to be fixed, or it could be that this has been around so long that we might have to make it the official behaviour.

I also have lots of spaces in my alert names, since a very long time. It works just fine.

--
(o- Julien Pivotto
//\ Open-Source Consultant
V_/_ Inuits - https://www.inuits.eu

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jutley picture jutley  路  3Comments

mdlayher picture mdlayher  路  3Comments

alexissavin picture alexissavin  路  3Comments

logemann picture logemann  路  3Comments

mysterytree picture mysterytree  路  4Comments