I've been asked to get a value from the prometheus instance we are running.

I want the metric "temp_in_c" for the past year for a number of the 
machines we are running.  The people that would like the data don't have 
access to the any of the data in any other way.

Working in python and this is what I'm trying and was wondering if it is 
correct?
start_date=str(time.mktime(datetime.date(2019,10,1).timetuple()))
end_date  =str(time.mktime(datetime.date(2019,10,2).timetuple()))
step_resolution='5m'  -- This is hardcoded below

response = requests.get('{}/api/v1/query'.format(hostname),params={'query': 
'temp_in_c','step':'5m','start':start_date,'end_input':end_date})

print(response)    ## This comes back as 200 which look ok
results = response.json()['data']['result']  ## This gives me [] nothing

There is data for this metric during that time so I figure I'm doing 
something wrong in my query?

Any ideas?

Thanks


-- 
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/6a9d55f8-10e1-475d-b589-a09725e1e06cn%40googlegroups.com.

Reply via email to