Skip to main content

aioworkers prometheus integration

Project description

https://github.com/aioworkers/aioworkers-prometheus/workflows/Tests/badge.svg https://codecov.io/gh/aioworkers/aioworkers-prometheus/branch/master/graph/badge.svg PyPI version Python versions

Use

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

Use in code

context.metric.my_counter.inc()
context.metric.my_histogram.observe(542)

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

Add global labels to default registry to exposition

prometheus:
  registry: aioworkers
  labels:
    env: prod

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: aioworkers.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.5.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

aioworkers_prometheus-0.5.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file aioworkers-prometheus-0.5.1.tar.gz.

File metadata

  • Download URL: aioworkers-prometheus-0.5.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for aioworkers-prometheus-0.5.1.tar.gz
Algorithm Hash digest
SHA256 91ed30fe0b297741cc00cf7112de84e01715dc0407174c466b4db994b3f30d78
MD5 f00c51c41fae2aac78befb3f5c3e1d5d
BLAKE2b-256 96cac72c8edc563b9e27c6fd11b5f77b2f0e33858c0ed4ff9bebe1b96ef87b97

See more details on using hashes here.

File details

Details for the file aioworkers_prometheus-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aioworkers_prometheus-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0882f9d9296b000047b13a7b7c19c9a6318f6dd7b55812b07bfac96884e9b4b
MD5 1e3e0d1fa39115b38ce939ab2acf69a6
BLAKE2b-256 521caf4ecb3a2ce8dee40eec54a80ce06712a23c4c26b22686d1f82ac450502c

See more details on using hashes here.

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