Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Library for aggregating metrics from the Prometheus monitoring system's python client library.

Project Description
# Prometheus Roller
[![Build Status](](
[![PyPI version](](
[![Python versions](](

This is a small helper utility for creating time-boxed rollups for histogram and counter metrics created using the [prometheus python client](

Metrics like counters and histograms increase indefinitely, but you usually care about recent activity. This library provides a way to turn a counter or histogram into a gauge or set of gauges that give instantaneous measures of the state of the application.

This isn't very useful if you're using [the prometheus server]( since it provides [functions to do that for you](, but if you are sending metrics to multiple places (e.g. [check_mk]( and you want to send those metrics in a form that make basic alerting and reporting easier, this may help.

## Usage

from prometheus_client import Histogram, Counter
from prometheus_roller import HistogramRoller, CounterRoller, start_update_daemon

# Create a histogram
h = Histogram('test_value', 'Testing roller')

# Create a counter
c = Counter('test_counted_value', 'Testing roller')

# Create a roller for the histogram, which calculates windowed values.
# By default it will create a gauge with a label for each histogram bin.
# The value of each gauge will be the change in value over the last 5 minutes, updated every 5 seconds.
# See the `options` parameter for more configuration options.
rh = HistogramRoller(h)

# Create a roller for the counter, which calculates windowed values.
# The value of each gauge will be the change in value over the last 5 minutes, updated every 5 seconds.
# See the `options` parameter for more configuration options.
rc = CounterRoller(c)

# Launch a daemon thread tracking and updating all roller objects.
# See the code for more options for configuring this update process.

## Installation

# Install with pip
pip install prometheus_roller

# To install as editable to work on it
pip install -e git+
# OR
git clone prometheus-roller
cd prometheus-roller
python develop

## Running tests

# Plain old python
python -m unittest discover

# If you have nose and coverage installed
nosetests --with-cover


* Add IQR reducer
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
prometheus_roller-0.0.2-py2.py3-none-any.whl (8.8 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Mar 23, 2016
prometheus_roller-0.0.2.tar.gz (5.6 kB) Copy SHA256 Checksum SHA256 Source Mar 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting