Skip to main content

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


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.3.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

metricz-0.1.3-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file metricz-0.1.3.tar.gz.

File metadata

  • Download URL: metricz-0.1.3.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for metricz-0.1.3.tar.gz
Algorithm Hash digest
SHA256 15975e41a06cc4d5cf9a3d3fecdbf833453727224fb7ef8a73f660a88e563a2f
MD5 a5e58b451a72839de264988e218b2b70
BLAKE2b-256 d0c6e0dcaddd4670f86f0700a8f50f9ee0d93e36f72381a9fe7cbeab9601c1f9

See more details on using hashes here.

Provenance

File details

Details for the file metricz-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for metricz-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6e4a2054d9d3531760ce4bf562c1a43bfd6c10506b5648d026fef6ef13094d9c
MD5 d2843159b1b93c12121d1b9de1cac5d6
BLAKE2b-256 7eab660fe2bc041a171cf056ea6793c03a76b2afe174f4ecf613e447accb4ac9

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page