Metricz
Metricz makes it easy to write metrics to a Kairosdb instance running with OAuth2 security.
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.
Metadata
Release files for metricz 0.1.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metricz-0.1.5.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Release files / metricz-0.1.5.3-py2.py3-none-any.whl
| Download URL | metricz-0.1.5.3-py2.py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
88e0eec0c6ffd984f1423a057b811022fb052f4afd8fd9a9047eb1ec1b5fff62
|
|
BLAKE2b-256 checksum How to use checksums |
d3f4ce659fb82eaf1d8e9361bb25206010d4deb173ff7d3aca3be3474bdd78f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |