Skip to content

Instantly share code, notes, and snippets.

@cfstras
Created June 30, 2025 11:56
Show Gist options
  • Save cfstras/7bd4511bd1176d908091683d4a3c72d0 to your computer and use it in GitHub Desktop.
Save cfstras/7bd4511bd1176d908091683d4a3c72d0 to your computer and use it in GitHub Desktop.
Cardinality overview of prometheus metrics
#!/bin/bash -euo pipefail
## Gives you a nice overview over the total timeseries cardinality of a prometheus endpoint.
curl -fsSL http://localhost:9100/metrics | grep -v '^#' | cut -d'{' -f 1 | cut -d' ' -f 1 | sort | uniq -c | sort -gr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment