Skip to content

api/series: return an empty array iff no results#1327

Merged
brancz merged 1 commit intothanos-io:masterfrom
GiedriusS:null_return
Jul 15, 2019
Merged

api/series: return an empty array iff no results#1327
brancz merged 1 commit intothanos-io:masterfrom
GiedriusS:null_return

Conversation

@GiedriusS
Copy link
Member

Prometheus' /series end-point returns an empty array no matter what: if
there were results or not. We need to follow the same principle in
Thanos as well because our users depend on it.

The same fix has been applied as here:
https://github.com/prometheus/prometheus/blob/fef150f1b5e48652ec6779e2129ae9a0cf13db8a/web/api/v1/api.go#L506

Tests have been updated to account for this difference and plus one test
has been added just for this case.

Closes #1325.

Prometheus' /series end-point returns an empty array no matter what: if
there were results or not. We need to follow the same principle in
Thanos as well because our users depend on it.

The same fix has been applied like here:
https://github.com/prometheus/prometheus/blob/fef150f1b5e48652ec6779e2129ae9a0cf13db8a/web/api/v1/api.go#L506

Tests have been updated to account for this difference and plus one test
has been added just for this case.

Closes thanos-io#1325.
@GiedriusS GiedriusS requested a review from bwplotka July 13, 2019 22:18
@GiedriusS GiedriusS changed the title api/v1: return an empty array iff no results api/series: return an empty array iff no results Jul 13, 2019
@brancz brancz merged commit 2dadd9c into thanos-io:master Jul 15, 2019
@bwplotka
Copy link
Member

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

query: Series API returns null data

3 participants