aioworkers prometheus integration
Project description
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
Check code:
hatch run lint:all
Format code:
hatch run lint:fmt
Run tests:
hatch run pytest
Run tests with coverage:
hatch run cov
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for aioworkers_prometheus-0.6a1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13f2798dea30d15a94fa9ec5f2560e543eba3962269f53001207b68ea9fcde6f |
|
MD5 | bf0d2b9368e436208f20ec132ad2e77a |
|
BLAKE2b-256 | a497d8a5e34b368a37ece234815a5ac7eb786def42757febabf6094e1649a66d |
Close
Hashes for aioworkers_prometheus-0.6a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca3c2a36b4d538c48cf589af4eb8ca45a03eb093250e25bd6b77f48222129466 |
|
MD5 | 4aaf1e5f484070b42163859a4f8e84fd |
|
BLAKE2b-256 | d7796a7da5695722b8ded4f693338573453cedca4291b96cce6658e0b2b8766f |