Unable to run mimirtool analyze prometheus

I’m on Grafana Cloud, and I want to figure out what unused metrics I have.

I’ve downloaded Mimirtool from the guide here , and I’ve been able to run it against grafana to create the metrics-in-grafana.json file with this command:

m@:~/mimirtool$ ./mimirtool analyze grafana --address $MIMIR_ADDRESS --key $MIMIR_API_KEY

But, when I try to do the analyze prometheus commmand, it doesn’t work…

m@:~/mimirtool$ ./mimirtool analyze prometheus --address=https://prometheus-prod-01-eu-west-0.grafana.net/api/prom --id=$PROMETHEUS_ID --key=$MIMIR_API_KEY --log.level=debug
INFO[0001] log level set to debug
mimirtool: error: error querying for metric names: terminated after 10 retries, try --help

Has anyone seen this? Any tips on how to resolve?

Your mimirtool has a problem to connect. It can be for different reasons. For example you don’t have correct CA certificates used by Mimir in your system, so mimirtool can’t create valid HTTP connection (it can happen in the enteprise env, where security guys run deep packet inspection).


curl -v https://prometheus-prod-01-eu-west-0.grafana.net/api/prom

from the same CLI as you are running mimirtool.

Thank you for you response. The problem was that I was using the same API key for both grafana and prometheus, I had to create a different key for prometheus. In retrospect it’s sort of obvious that there are different accounts for Prometheus and Grafana…