Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

A set of decorators and helper methods for adding statsd metrics to applications.

Project description

# Statsdecor

[![Software License](](LICENSE.txt)
[![Build Status](](

A set of decorators and helper methods for adding statsd metrics to applications.

## Installation

You can use pip to install statsdecor:

pip install statsdecor

## Configuration

You must use `statsdecor.configure` to configure the internal statsd client before
calling other methods:

import statsdecor

statsdecor.configure(host='localhost', prefix='superapp.')

Configuration is generally setup during your application's bootstrap. Once
set configuration values are re-used in all clients that `statsdecor` creates.

## Usage

You can track metrics with either the module functions, or decorators. Incrementing
and decrementing counters looks like:

### Metric functions

import statsdecor

statsdecor.gauge('', 9001)

Counters and timers can also be set through decorators:

import statsdecor.decorators as stats

def save(self):

def attempt():

def perform_request(self, req)

When using decorators, metrics are only tracked if the decorated function
does not raise an error.

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
statsdecor-0.3.4-py2.py3-none-any.whl (4.1 kB) Copy SHA256 hash SHA256 Wheel 3.6 May 4, 2018
statsdecor-0.3.4.tar.gz (6.3 kB) Copy SHA256 hash SHA256 Source None May 4, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page