Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range query doesn't support 10s resolution if the time range spanning 2 days? #1968

Closed
zxwing opened this Issue Sep 9, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@zxwing
Copy link

zxwing commented Sep 9, 2016

The following queries data for 2 days with the resolution 10s:

[root@172-20-11-202 ~]# wget 'http://172.20.11.202:9090/api/v1/query_range?query=collectd%3Acollectd_virt_memory&start=1473220095&end=1473392838&step=10s' -O stdout
--2016-09-09 11:54:47--  http://172.20.11.202:9090/api/v1/query_range?query=collectd%3Acollectd_virt_memory&start=1473220095&end=1473392838&step=10s
Connecting to 172.20.11.202:9090... connected.
HTTP request sent, awaiting response... 400 Bad Request
2016-09-09 11:54:47 ERROR 400: Bad Request.

the start 1473220095 = 9/7/2016, 11:48:15 AM GMT+8:00 and the end 1473392838 = 9/9/2016, 11:47:18 AM GMT+8:00, which are two days.

However, if I change the step to 1m, the same query works:

[root@172-20-11-202 ~]# wget 'http://172.20.11.202:9090/api/v1/query_range?query=collectd%3Acollectd_virt_memory&start=1473220095&end=1473392838&step=1m' -O stdout
--2016-09-09 12:01:27--  http://172.20.11.202:9090/api/v1/query_range?query=collectd%3Acollectd_virt_memory&start=1473220095&end=1473392838&step=1m
Connecting to 172.20.11.202:9090... connected.
HTTP request sent, awaiting response... 200 OK

So how should I determine what resolution to use? I think there is a caveat.

BTW: can we give out a clear error message in HTTP body? The 400 error is horrible for debug

@grobie

This comment has been minimized.

Copy link
Member

grobie commented Sep 9, 2016

We set a hard-limit of 11k data points per single query.

BTW: can we give out a clear error message in HTTP body? The 400 error is horrible for debug

I think the error output is very clear.

curl http://localhost:9090/api/v1/query_range\?query\=foo\&start\=1473220095\&end\=1473392838\&step\=10s
{"status":"error","errorType":"bad_data","error":"exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)"}

With wget it's a bit more laborious as it usually doesn't bother saving the output on error response codes.

wget -qO - --content-on-error http://localhost:9090/api/v1/query_range\?query\=foo\&start\=1473220095\&end\=1473392838\&step\=10s
{"status":"error","errorType":"bad_data","error":"exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)"}
@zxwing

This comment has been minimized.

Copy link
Author

zxwing commented Sep 9, 2016

Thanks @grobie, it's clear now

@zxwing zxwing closed this Sep 9, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.