Skip to main content

send timing and exception stats to riemann

Project description

riemann_wrapper: time functions with riemann
============================================

Introductory blog post: http://www.spootnik.org/entries/2013/05/21_using-riemann-to-monitor-python-apps.html

This library is provided to allow timing and exception reporting
of python functions using http://riemann.io.

Installing
----------
Pip:

``pip install riemann_wrapper``

Pypi:

https://pypi-hypernode.com/pypi/riemann_wrapper

Manual:

``python setup.py install``

Usage
-----


Provide a metric name and a bernhard client for timing:

::

import bernhard
from riemann_wrapper import wrap_rieman, riemann_wrapper

riemann = bernhard.Client()

@wrap_riemann("cpu-intensive-task", client=riemann)
def do_something_cpu_intensive():
# [...]

::

Call options:
-------------

The following keyword args may be passed to ``wrap_riemann``:

* ``client``: instance of ``bernhard.Client`` to send events with
* ``tags``: tags to attach to riemann events
* ``host``: override hostname for the event

Alternately, a new wrapping function can be created by calling
``riemann_wrapper`` like-so:

::

import bernhard
from riemann_wrapper import wrap_riemann, riemann_wrapper

riemann = bernhard.Client()
my_wrapper = riemann_wrapper(client=berhard.Client(), prefix="myapp.")

@my_wrapper("cpu-intensive-task")
def do_something_cpu_intensive():
# [...]

::

The following keyword args may be passed to ``riemann_wrapper``:

* ``client``: instance of ``bernhard.Client`` to send events with
* ``global_tags``: tags present in all sent events
* ``host``: override hostname for all events
* ``prefix``: prepend given string to all event services

Project details


Download files

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

Source Distribution

riemann_wrapper-0.5.0.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file riemann_wrapper-0.5.0.tar.gz.

File metadata

File hashes

Hashes for riemann_wrapper-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8024226d0c993afcd0c9ec9184f66ba1c7dc6594e9498c61f18b37f5bef0c53f
MD5 279105efb8b4f94eb1e39e5ba7f99161
BLAKE2b-256 fe888b836bda214663db12925ede46e5b609ce5120cd40b5e4f876156365eedc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page