docs icon indicating copy to clipboard operation
docs copied to clipboard

Comparison binary operators

Open bestboylm opened this issue 3 years ago • 2 comments

“Between an instant vector and a scalar” I get a result which does not match the description of the section.

See attached picture for details!!!

promql1

bestboylm avatar Mar 30 '22 03:03 bestboylm

I'm not sure I understand the what the question is? The purpose of using the bool operator means that for example the value is like this. If some imaginary values that would match your query results.

prometheus_http_requests_total{code="200", handler="/-/ready", instance="localhost:9090", job="prometheus"} 96
prometheus_http_requests_total{code="200", handler="/api/v1/query_range", instance="localhost:9090", job="prometheus"} 105

Would result based on the query as:

prometheus_http_requests_total{code="200", handler="/-/ready", instance="localhost:9090", job="prometheus"} 0
prometheus_http_requests_total{code="200", handler="/api/v1/query_range", instance="localhost:9090", job="prometheus"} 1

Whereas if you queried:

prometheus_http_requests_total > 100

Then you would only receive:

prometheus_http_requests_total{code="200", handler="/api/v1/query_range", instance="localhost:9090", job="prometheus"} 105

hdost avatar May 16 '22 08:05 hdost

@bestboylm Does this answer your question?

hdost avatar May 31 '22 08:05 hdost