Skip to main content

aioworkers prometheus integration

Project description

https://travis-ci.org/aioworkers/aioworkers-prometheus.svg?branch=master Python versions https://img.shields.io/pypi/v/aioworkers-prometheus.svg

Use

metric:
  registry: aioworkers
  namespace: aioworkers_test_metric
  metrics:
    counter:
      type: counter
      name: test_counter
      documentation: Counter for tests
    histogram:
      type: histogram
      name: test_histogram
      documentation: Histogram for tests
      buckets: [30, 90, 100, 200, 400, 800]

Use in code

context.metric.counter.inc()
context.metric.histogram.observe(542)

with context.metric.histogram.time():
    await asyncio.sleep(1)

Serve port 8000 for prometheus

prometheus:
  port: 8000
  registry: aioworkers

Push to graphite localhost:9090

prometheus:
  registry: aioworkers
  graphite:
    address: localhost:9090
    interval: 1m
    prefix: aioworker.test

Development

Install dev requirements:

pipenv install --dev --skip-lock

Run tests:

pipenv run pytest

Project details


Download files

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

Files for aioworkers-prometheus, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size aioworkers-prometheus-0.3.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

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