I'm trying to get a very simple example of pushing Graphite metrics to Grafana Cloud using their HTTP API to work.
This example comes straight from the Graphite HTTP API documentation:
user_id=<USER_ID>
api_key=<API_KEY>
url=https://<SERVER_INSTANCE>.grafana.net/graphite/metrics
timestamp_now_rounded=$(($(date +%s) / 10 * 10))
timestamp_prev_rounded=$((timestamp_now_rounded - 10))
curl -X POST -H "Authorization: Bearer $user_id:$api_key" -H "Content-Type: application/json" "$url" -d '[{
"name": "test.metric.tagged",
"interval": 10,
"value": 2,
"tags": ["foo=bar", "baz=quux"],
"time": '$timestamp_now_rounded'
}]'
When I run this script I get:
{"status":"error","error":"authentication error: invalid authentication credentials"}
I am not sure which credentials to use. I have already tried creating a service account and a cloud access policy with write permissions, and none of the credentials seem to work.


