Hello,
I am trying to query Prometheus metrics using curl. From what I read on the
Prometheus HTTP API, I need to supply start and end times in RFC3339 or
timestamp format.
The query I want to produce:
curl -s -g -k -X GET -H "Authorization: Bearer $TOKEN" -H 'Accept:
application/json' -H 'Content-Type: application/json'
"$URL/api/v1/query_range?query=(sum(rate(container_cpu_usage_seconds_total{pod!=\"\",
container!=\"\"}[1h]))by(namespace))&start=2022-08-21T07:00:00+03:00&end=2022-08-21T09:00:00+03:00&step=1h"
The following error occurred when I used rfc3339 format: "Cannot parse
\"2022-08-21T07:00:00 03:00\" to a valid timestamp".
Any time zone that starts with "-" (for example, -03:00) or the default (Z)
gives me results. The "+" appears to be converted to a space.
My other attempts were:
1. I declared the "+" as a variable (export $var="+")
2. I wrote the query under ' ' (I wrote the full URL address)
I still receive the same error message.
Thanks in advance,
Shirley
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/b12c48a5-1bd7-41d3-9974-a6ea7c6b3c1en%40googlegroups.com.