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.python.org/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_riemann, 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
logger: a standard python logger to which transport errors may be logged
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=bernhard.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. Default: ['python'].
host: override hostname for all events. Default: None.
logger: a standard python logger to which transport errors may be logged. Default: None.
prefix: prepend given string to all event services. Default: python.
exception_state: state sent for exceptions. Default: 'warning'.
send_exceptions: boolean or callable that takes an exceptions as a parameter and returns a boolean to specify whether to send that particular exception to riemann. Default: True.
Metadata
Release files for riemann_wrapper 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| riemann_wrapper-0.6.2.tar.gz | 2.9 kB | Without provenance | Details for riemann_wrapper-0.6.2.tar.gz |
Release files / riemann_wrapper-0.6.2.tar.gz
| Download URL | riemann_wrapper-0.6.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd6d2cfa155b80e0d913241291ad47454b4131ccdef3f93ccc8c233b98517e09
|
|
BLAKE2b-256 checksum How to use checksums |
5fdb83d74e50d1532afcc12dd53d89d1957765c5bc5c94bc00f8a68ad2434e78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for riemann_wrapper 0.6.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.