Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prometheus rule: check for expression value in range

Tags:

prometheus

In a prometheus alert rule, how do I check for a value to be in a certain range?

for eg., (x > 80 && x <= 100); 

when x is a complex expression it feels unnecessary to evaluate it twice. is there another way to represent this expression?

like image 923
vrtx54234 Avatar asked Aug 19 '17 00:08

vrtx54234


People also ask

How do you check Prometheus rules?

Configuring rules To include rules in Prometheus, create a file containing the necessary rule statements and have Prometheus load the file via the rule_files field in the Prometheus configuration. Rule files use YAML. The rule files can be reloaded at runtime by sending SIGHUP to the Prometheus process.

How do you check data on Prometheus?

Let us explore data that Prometheus has collected about itself. To use Prometheus's built-in expression browser, navigate to http://localhost:9090/graph and choose the "Table" view within the "Graph" tab.

What is range vector in Prometheus?

Range vector - a set of timeseries where every timestamp maps to a “range” of data points, recorded some duration into the past. Range vector is mostly used for graphs, where you want to show a PromQL expression over a given time range.

How do you display results in Prometheus?

The result of an expression can either be shown as a graph, viewed as tabular data in Prometheus’s expression browser, or consumed by external systems via the HTTP API. We first explore a range vector. Range vector — a set of time series containing a range of data points over time for each time series. …

What are the different types of expressions in Prometheus?

In Prometheus's expression language, an expression or sub-expression can evaluate to one of four types: Instant vector - a set of time series containing a single sample for each time series, all sharing the same timestamp Range vector - a set of time series containing a range of data points over time for each time series

What is the default evaluation interval in Prometheus?

Default is the global evaluation interval. Prometheus supports many binary and aggregation operators. These are described in detail in the expression language operators page. Prometheus supports several functions to operate on data. These are described in detail in the expression language functions page.

What is querying in Prometheus?

Querying Prometheus. Prometheus provides a functional query language called PromQL (Prometheus Query Language) that lets the user select and aggregate time series data in real time. The result of an expression can either be shown as a graph, viewed as tabular data in Prometheus's expression browser, or consumed by external systems via the HTTP API.


1 Answers

You can do x < 100 > 80 to chain them.

like image 193
brian-brazil Avatar answered Oct 20 '22 08:10

brian-brazil