Promckle is a Python package for reading Prometheus TSDB blocks.
Promckle allows you to read Prometheus TSDB blocks so that you can process or analyse them in Python. Promckle is great if you have TSDB dumps and would like to get a feel for what time series are present.
Prometheus TSDB blocks are structured as shown here.
You will need to have Go installed to build the prometheus-tsdb-dump binary.
Additionally, ensure that you have Python 3.10 or higher installed.
Clone or download the repo to where you would like to use promckle and run the setup.
cd promckle
make setupMake sure you have a Python environment ready with all the necessary packages installed.
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txtfrom promckle import DataLoader
# Initialise dataloader
dataloader = DataLoader()
# Read a block
dataloader.read_block('/path/to/tsdb/block')
# Promckle can read multiple blocks
dataloader.read_block('/path/to/tsdb/block2')
# And store the data in a single dataframe
df = dataloader.to_dataframe()
# Or write directly to disk
dataloader.to_parquet('/path/to/output.parquet')