It is now part of https://github.com/grafana/cortex-tools
This repo contains a set of tools that can be run against your Grafana, Prometheus and Cortex clusters to analyse which metrics are actually being used and which metrics can be dropped.
This command will be run against your Grafana instance and it will download the dashboards and pick the Prometheus metrics that are used in the queries. The output is a JSON file.
Env Variables | Flag | Description |
---|---|---|
GRAFANA_ADDRESS | address |
Address of the Grafana instance. |
GRAFANA_API_KEY | key |
The API Key for the Grafana instance. Create a key using the following instructions: https://grafana.com/docs/grafana/latest/http_api/auth/ |
__ | output |
The output file path. metrics-in-grafana.json by default. |
prom-cloud-analyser grafana-analyse --address=<grafana-address> --key=<API-Key>
This command will be run against your Prometheus / GrafanaCloud instance and it will use the output from grafana-analyse
show you how many series in the Prometheus server are actually being used in dashboards. The output is a JSON file
Env Variables | Flag | Description |
---|---|---|
PROMETHEUS_ADDRESS | address |
Address of the Prometheus instance. |
PROMETHEUS_USER | username |
If you're using GrafanaCloud this is your instance ID. |
PROMETHEUS_PASSWORD | password |
If you're using GrafanaCloud this is your API Key. |
__ | grafana-metrics-file |
The input file path. metrics-in-grafana.json by default. |
__ | output |
The output file path. prometheus-metrics.json by default. |
prom-cloud-analyser prometheus-analyse --address=https://prometheus-us-central1.grafana.net/api/prom --username=<1234> --password=<API-Key> --log.level=debug
Licensed Apache 2.0, see LICENSE.