Skip to content

Commit

Permalink
fix article
Browse files Browse the repository at this point in the history
  • Loading branch information
riupie committed Nov 26, 2023
1 parent 376a1f5 commit 786aac9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions content/blog/tidy-up-prometheus-metrics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ $ mimirtool analyze grafana --address=https://grafana.rahmatawe.com --key="glsa_
Anw, you can get `GRAFANA_API_TOKEN` by creating service account on Grafana dashboard.
![image](imgs/grafana-service-account.png)

Above command will generate file named `metrics-in-grafana.json`. Using this file, we will compare it to metrics stored in Prometheus. Then use below command to generate list of metrics that being used and unused.
Above command will generate file named `metrics-in-grafana.json`. Using this file, we will compare it to metrics stored in Prometheus.
```bash
#port forward to prometheus
$ kubectl port-forward prometheus-prometheus-0 9090:9090 -n monitoring

# Compare grafana metrics and
# Compare grafana metrics and prometheus
$ mimirtool analyze prometheus --grafana-metrics-file="metrics-in-grafana.json" --address=http://localhost:9090

INFO[0002] 73815 active series are being used in dashboards
Expand Down Expand Up @@ -80,3 +80,7 @@ metadata:
```

That's it. Simple task to drop your bloated Prometheus metrics. Bye!

Ref:
* https://medium.com/@dotdc/prometheus-performance-and-cardinality-in-practice-74d5d9cd6230
* https://www.robustperception.io/dropping-metrics-at-scrape-time-with-prometheus/

0 comments on commit 786aac9

Please sign in to comment.