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.

Source Distribution

aioworkers-prometheus-0.2.tar.gz (4.4 kB view hashes)

Uploaded Source

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