loki icon indicating copy to clipboard operation
loki copied to clipboard

Using absent_over_time with logical operator returns "Unimplemented" error.

Open tonychoe opened this issue 3 years ago • 2 comments

Describe the bug Using absent_over_time with logical operator returns "Unimplemented" error.

I am working to make a metric query that don't return NULL as the following example.

sum(count_over_time({namespace="traefik"} |= "foo" [1m]))
or
sum(absent_over_time({namespace="traefik"} |= "foo" [1m])) == bool 

Using the 2nd query with absent_over_time alone works fine. But when I use it with 1st query with logical operator didn't work ("Unimplemented" error). I tried using different logical operators and swap 1st and 2nd but the same error.

To Reproduce Run the query like the above example.

Expected behavior No error returned from the query.

Environment:

  • Loki 2.5
  • Grafana 9.0.7

Screenshots, Promtail config, or terminal output

Screen Shot 2022-08-19 at 1 23 23 PM

tonychoe avatar Aug 19 '22 20:08 tonychoe

The same error

count_over_time({container_name="jsoncollector"}[2m]|="error") or absent_over_time({container_name="jsoncollector"}[2m]|="error")

⚠️ Unimplemented

vsile avatar Dec 05 '22 06:12 vsile

I think that this issue might be bug but it seems that the original purpose can be archived by using the query below.

sum(count_over_time({namespace="traefik"} |= "foo" [1m]))
or
vector(0)

Ref: https://grafana.com/docs/loki/latest/query/metric_queries/#functions

monolith-jaehoon avatar May 23 '24 08:05 monolith-jaehoon