I’m a first-time user of Grafana and Grafana Cloud.
My goal is to set up a dashboard in Grafana Cloud with data comes from our local Python app. For that I want to push the data via the the Prometheus URL, doing something like this:
def send_grafana_metrics():
"""
Send metrics to Grafana
"""
url = "https://<domain>.grafana.net/api/prom/push"
response = requests.post(
url=url,
headers={"Content-Type": "text/plain"},
data="test,bar_label=abc,source=grafana_cloud_docs metric=35.2",
auth=(USERNAME, API_KEY),
)
I have the Prometheus URL, username and API key.
When I run the above, I get the error:
'decompress snappy: snappy: corrupt input\n'
What might I be doing wrong?