Metricz makes it easy to write your metrics to the Bus kairosdb instance.
Project description
Metricz
Metricz makes it easy to write your metrics to the Bus kairosdb instance.
Features
OAuth2 support.
Option to batch write metrics at a later time.
Usage
To simply write a metric:
from metricz import MetricWriter
mw = MetricWriter(directory='/path/to/credentials/dir)
mw.write_metric('some.metric.name', 123, {'some': 'tag'})
To write a metric with a custom timestamp:
import datetime
# Make sure this is in UTC.
timestamp = datetime.datetime(1981, 10, 26, 6, 24)
mw.write_metric('some.metric.name', 34, {'some': 'tag'}, timestamp)
To batch write metrics:
# These are NOT written directly.
mw.defer_metric('some.metric.name', 42, {'some': 'tag'})
mw.defer_metric('some.other.metric.name', 64, {'some': 'tag'})
mw.defer_metric('some.other.metric.name', 64, {'some': 'tag'})
# Write all deferred metrics at once.
mw.write_deferred()
TODO
Retry on failure.
Look at non-blocking options to write.
History
0.1.0 (2016-08-03)
First release on PyPI.
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
metricz-0.1.2.tar.gz
(13.2 kB
view hashes)
Built Distribution
Close
Hashes for metricz-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97e5377a330dfd2b2227d03e773b0d88db78fb8434eb9a5fcc767eb294d5f866 |
|
MD5 | 8da382b9948180f9d2b35b8ec408c7d9 |
|
BLAKE2b-256 | b599aab904f2183d0b58f25141959ec3037830c891eb8f3a035ef54976e28b97 |