Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Metricz makes it easy to write metrics to a Kairosdb instance running with OAuth2 security.

Project description

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.

Project details


Release history Release notifications

This version
History Node

0.1.5.3

History Node

0.1.5.2

History Node

0.1.5.1

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
metricz-0.1.5.3-py2.py3-none-any.whl (6.3 kB) Copy SHA256 hash SHA256 Wheel 3.6 Dec 19, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page