I was going through promQL querying basics and noticed a statement which does not make sense.
In contrast, these expressions are valid as they both have a selector that does not match empty label values.
{job=~".+"} # Good!
{job=~".*",method="get"} # Good!
The documentation says that a vector selector should specify at least one label matcher that does not match with empty value. However, the below vector selector does not have a name, also it has just one label matcher that matches with empty value.
{job=~".+"}
can you help me understand why the documentations says it’s a valid selector?
ref: https://prometheus.io/docs/prometheus/latest/querying/basics/
I tried to find the difference between .*
and .+
. I found one reference https://docs.logz.io/docs/user-guide/infrastructure-monitoring/introduction-to-prometheus/promql-query/ which says .*
is not allowed in promQL but I see it used everywhere.
yash sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.