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-08T00:00:00Z&end=2020-06-09T18:00:00Z&step=30'

api result below show that timestamp 1591607520, 1591607550, 1591607580  are 
not the scape time I guess..

 "values": [
                    [
                        1591607520,
                        "2270"
                    ],
                    [
                        1591607550,
                        "2270"
                    ],
                    [
                        1591607580,
                        "2270"
                    ],



在 2020年6月9日星期二 UTC+8下午11:16:49,Brian Brazil写道:
>
> On Tue, 9 Jun 2020 at 16:15, 林浩 <[email protected] <javascript:>> 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"
>>                     ],
>>                     [
>>                         1591607550,
>>                         "2270"
>>                     ],
>>                     [
>>                         1591607580,
>>                         "2270"
>>                     ],
>>
>> for the UNIX timestamp, is that really reflex to scrap time?
>> since I see some scrape setting 
>>
>> global:
>>   scrape_interval: 2m
>>   scrape_timeout: 2m
>>   evaluation_interval: 1m
>>
>>
>> because Prometheus using pull to get metric,  so is there any way I can 
>> get precise scape UNIX timestamp from API ?
>>
>
> You can use the timestamp() function, or use a query with a range vector 
> to get the raw samples. 
>
> -- 
> Brian Brazil
> www.robustperception.io
>

-- 
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/0112d692-004a-4854-9021-06cc18975b56o%40googlegroups.com.

Reply via email to