Your message dated Thu, 2 Mar 2017 04:22:10 -0300
with message-id <88e3341f-b2ae-b66a-1745-c3294b0bd...@tincho.org>
and subject line Re: [pkg-go] Bug#856314: HTTP API does not understand non-UTC 
date values
has caused the Debian Bug report #856314,
regarding HTTP API does not understand non-UTC date values
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
856314: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856314
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: prometheus
Version: 1.5.2+ds-2
Severity: normal

When I call the Prometheus HTTP API using a localized date string, the API
cannot parse it to a valid timestamp. Changing the string to UTC / Zulu
makes the API work.

Examples:

Invalid URL:

http://localhost:9090/api/v1/query_range?query=node_load1{instance=
"localhost:9100",job="node"}&start=2017-02-27T21:19:19+08:00&end=2017-02-28T00:19:19+08:00&step=60m

Response:

{"status":"error","errorType":"bad_data","error":"cannot parse
\"2017-02-27T21:19:19 08:00\" to a valid timestamp"}

Valid URL:

http://localhost:9090/api/v1/query_range?query=node_load1{instance=
"localhost:9100",job="node"}&start=2017-02-27T13:20:02Z&end=2017-02-27T16:20:02Z&step=60m

Valid response:

{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"__name__":"node_load1","instance":"localhost:9100","job":"node"},"values":[[1488205202,"0.1"],[1488208802,"0"],[1488212402,"0"]]}]}}

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages prometheus depends on:
ii  daemon                                   0.6.4-1
ii  libc6                                    2.24-9
ii  libjs-bootstrap                          3.3.7+dfsg-2
ii  libjs-eonasdan-bootstrap-datetimepicker  4.17.43-1
ii  libjs-jquery                             3.1.1-2
ii  libjs-jquery-hotkeys                     0~20130707+git2d51e3a9+dfsg-2
ii  libjs-moment                             2.17.1+ds-1
ii  libjs-mustache                           2.3.0-2
ii  libjs-rickshaw                           1.5.1.dfsg-1

Versions of packages prometheus recommends:
ii  prometheus-node-exporter  0.13.0+ds-1

prometheus suggests no packages.

-- no debconf information


-- 
Edward C. Lang

http://edlang.org/

--- End Message ---
--- Begin Message ---
On 27/02/17 13:22, Edward Lang wrote:

> When I call the Prometheus HTTP API using a localized date string, the
> API cannot parse it to a valid timestamp. Changing the string to UTC /
> Zulu makes the API work.

> http://localhost:9090/api/v1/query_range?query=node_load1{instance="localhost:9100",job="node"}&start=2017-02-27T21:19:19+08:00&end=2017-02-28T00:19:19+08:00&step=60m
> 
> Response:
> 
> {"status":"error","errorType":"bad_data","error":"cannot parse
> \"2017-02-27T21:19:19 08:00\" to a valid timestamp"}

Actually, the key to your problem is in the error message: the "+" sign
is interpreted as an space in a URI string. If you encode it as "%2B",
the API works correctly.

This command returns data successfully for me:

$ curl
'http://localhost:9090/api/v1/query_range?query=up&start=2017-02-27T21:19:19%2B08:00&end=2017-02-28T00:19:19%2B08:00&step=60m'


-- 
Martín Ferrari (Tincho)

--- End Message ---
_______________________________________________
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Reply via email to