Skip to content

Promckle is a Python package for reading Prometheus TSDB blocks.

License

Notifications You must be signed in to change notification settings

antonhosgood/promckle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Promckle

Promckle is a Python package for reading Prometheus TSDB blocks.

Description

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.

Installation

Prerequisites

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.

Setup

Clone or download the repo to where you would like to use promckle and run the setup.

cd promckle
make setup

Make 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.txt

Usage

from 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')

About

Promckle is a Python package for reading Prometheus TSDB blocks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors