Created
June 15, 2025 11:22
-
-
Save ianhomer/5dc7d077dcdc41d75df0a7eae2133e04 to your computer and use it in GitHub Desktop.
Prune Prometheus Metrics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Enable prom web Admin API - --web.enable-admin-api | |
| # Tunnel to prometheues API | |
| kubectl port-forward -n monitoring prometheus-prometheus-kube-prometheus-prometheus-0 9999:9090 | |
| # List __name__ value | |
| curl -g http://localhost:9999/api/v1/label/__name__/values | jq | less | |
| # Prune by query | |
| curl -X POST http://localhost:9999/api/v1/admin/tsdb/delete_series --data-urlencode 'match[]={__name__=~"apiserver.*"}' | |
| # Clean tombstones | |
| curl -X POST -g http://localhost:9999/api/v1/admin/tsdb/clean_tombstones |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment