send timing and exception stats to riemann
Project description
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
exception_state: state sent for exceptions. Default: 'warning'.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file riemann_wrapper-0.5.7.tar.gz
.
File metadata
- Download URL: riemann_wrapper-0.5.7.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0005e45e5459e0bbad69080778cf355dc77f4c39d433266889af1ee5e5cf5565 |
|
MD5 | 750956ff344a2fe93ae32a0a129c80d1 |
|
BLAKE2b-256 | 25b41e3b8baa40f084e10efe5c9e13a48a7a0e519ecc062ba596b1f2e725e818 |