GoogleCloudPlatform / GoogleCloudPlatform/prometheus-engine

frontend: aggregate functions on missing label-values return a `null` result instead of `[]`

Open
#1,645 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
232
Forks
109
Avg merge
1d 3h
Merged PRs (30d)
27

Description

Hi folks.

I noticed a small difference between the behaviour of OSS Prometheus and the frontend component in the `query_range` API:

* Given a metric `foo` with label values `bar="0"` and `bar="1"`
* If I run an aggregate query on a non-existent label-value like `count(foo{bar="2"})`,
* The result in OSS Prometheus is:
* `{"status":"success","data":{"resultType":"matrix","result":[]}}`
* The result in prometheus-engine's frontend is:
* `{"status":"success","data":{"resultType":"matrix","result":null}}`

This causes the frontend to break (query ui disappears; screen becomes empty) and causes issues for some prometheus tools like pint.

Is it possible to preserve compatibility and return an empty array in this case instead of `null`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.