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

Fix parameter conversion errors and simplify request time parsing #24

Merged

Conversation

mattbostock
Copy link
Contributor

@mattbostock mattbostock commented Apr 7, 2018

Simplify the request time parsing to only accept values documented in
the Prometheus HTTP API docs:
https://prometheus.io/docs/prometheus/latest/querying/api/

...which also means removing the ability to pass relative times.

Do this to simplify the implementation and align the API more closely to
the values accepted by Prometheus' HTTP API.

Also fixes this error, which I found was occuring whenever a float value
was passed to the API:

time=2018-04-07T11:08:39.715529214Z app=trickster caller=trickster/handlers.go:385 level=error event="request parameter parser error" paramName=start paramValue=1523097519.71 detail="strconv.ParseInt: parsing \"1523097519.71000\": invalid syntax"

The values in the test fixtures are taken the examples in the Prometheus
documentation:
https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries

...and from empirical testing using Prometheus version 2.2.0-rc.1.
Simplify the request time parsing to only accept values documented in
the Prometheus HTTP API docs:
https://prometheus.io/docs/prometheus/latest/querying/api/

...which also means removing the ability to pass relative times.

Do this to simplify the implementation and align the API more closely to
the values accepted by Prometheus' HTTP API.

Also fixes this error, which I found was occuring whenever a float value
was passed to the API:

    time=2018-04-07T11:08:39.715529214Z app=trickster caller=trickster/handlers.go:385 level=error event="request parameter parser error" paramName=start paramValue=1523097519.71 detail="strconv.ParseInt: parsing \"1523097519.71000\": invalid syntax"
Copy link
Member

@jranson jranson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm RIP, relative time converter! @mattbostock thank you for contributing and holding us to good standards

@jranson jranson merged commit 931b53e into trickstercache:master Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants