I’m writing metrics to Grafana Cloud with http requests using Python. All works fine until I try to write a value that is too old or too far into the future - in the Billing/Usage dashboard I see too_far_in_future or too_far_in_past under Discarded Metric Samples.
The reason why I want this is because once a day I am receiving an hourly price list, and in my dashboard I would not only like to display real time values but also this price list for the whole day - including future hours.
Is there any way of changing the allowed timestamp range of metrics? I can’t seem to find a setting for this in the Grafana Cloud interface or find any info on how to change this.
Python code used
# Works without the timestamp
body = 'test,bar_label=abc,source=grafana_cloud_docs metric=0.0 1661369185000000000'
response = requests.post('https://prometheus-prod-24-prod-eu-west-2.grafana.net/api/prom',
headers={'Content-Type': 'text/plain'},
data=body,
auth=(f"{secrets.USERNAME}", f"{secrets.API_TOKEN}")
)