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