Re: [prometheus-users] how to get precise scape timestamp

2020-06-11 Thread 林浩
I see. many thanks Brain! 在 2020年6月10日星期三 UTC+8下午8:34:36,Brian Candler写道: > > Not in prometheus - because it's an API. The consumer of the API is > responsible for rendering the time in human-readable form. >> >> > However, you can always write a little Python script or whatever that > replaces

Re: [prometheus-users] how to get precise scape timestamp

2020-06-10 Thread Brian Candler
Not in prometheus - because it's an API. The consumer of the API is responsible for rendering the time in human-readable form. > > However, you can always write a little Python script or whatever that replaces each time value with a string. -- You received this message because you are subscrib

Re: [prometheus-users] how to get precise scape timestamp

2020-06-10 Thread 林浩
Thank Brian Candler & Brian Braizil !! The last question, is there the way I can transform UNIX timestamp to human readable time string in the below API you give? curl -Ssg 'localhost:9090/api/v1/query?query=up{instance="sw1"}[5m]' 在 2020年6月10日星期三 UTC+8下午3:04:15,Brian Candler写道: > > As Brian

Re: [prometheus-users] how to get precise scape timestamp

2020-06-10 Thread Brian Candler
As Brian said, use a range vector query rather than an instant query. # curl -Ssg 'localhost:9090/api/v1/query?query=up{instance="sw1"}[5m]' | python3 -mjson.tool { "status": "success", ... [ 1591772319.53, "1"

Re: [prometheus-users] how to get precise scape timestamp

2020-06-09 Thread 林浩
Brian, How can I get raw samples with exactly scraping time from Prometheus by the range query? I use this call to query data , and use parameter step=30, curl --location --request GET 'http://xxx:9090/api/v1/query_range?query=node_processes_state{state%3D%27D%27}%20%3E%20500&start=2020-06-08T

Re: [prometheus-users] how to get precise scape timestamp

2020-06-09 Thread Brian Brazil
On Tue, 9 Jun 2020 at 16:15, 林浩 wrote: > when I use range query api to get data point, for example I using step 30s > > API return me data like these > > "values": [ > [ > 1591607520, > "2270" > ], >

[prometheus-users] how to get precise scape timestamp

2020-06-09 Thread 林浩
when I use range query api to get data point, for example I using step 30s API return me data like these "values": [ [ 1591607520, "2270" ], [ 1591607550,