Utils fot prometheus-client
Project description
Utils for prometheus-client
Poetry plugin to set package version based on git tag.
Functionality
- Push clients
- pushgateway
- statsd
Quick start
pip install prometheus-client-utils
Example
import asyncio
from random import randint
from prometheus_client import REGISTRY, Counter, Histogram
from prometheus_client_utils.collectors import AsyncioCollector
from prometheus_client_utils.push_clients import PushGatewayClient
m_count = Counter('iters', 'count')
m_histogram = Histogram('iters_time', 'histogram')
semaphore = asyncio.Semaphore(50)
@m_histogram.time()
async def inner():
async with semaphore:
m_count.inc()
await asyncio.sleep(randint(0, 10))
async def main():
loop = asyncio.get_running_loop()
REGISTRY.register(AsyncioCollector(loop))
push_client = PushGatewayClient('localhost', 'test')
push_client.schedule_push(5, loop)
for i in range(10000):
await asyncio.sleep(i / 100)
loop.create_task(inner())
if __name__ == '__main__':
asyncio.run(main())
Contribute
Issue Tracker: https://gitlab.com/rocshers/python/poetry-git-version-plugin/-/issues
Source Code: https://gitlab.com/rocshers/python/poetry-git-version-plugin
Before adding changes:
make install-dev
After changes:
make format test
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 prometheus_client_utils-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49c1669ceb3fa655d08d066f24af4d2d939807a82ab9f14b5b6aef84a9a1b18e |
|
MD5 | 1f4047d5eaae478d3a079f2e9a1ff154 |
|
BLAKE2b-256 | 409642d952b63bc4e53e7876f5fd93d76e448e3e584554a8aa33cd69cbd8944d |
Close
Hashes for prometheus_client_utils-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e6b5b894bed6d4705b440b131cae60c0cdc6c0d9e7b0ef6c213f54ad5e8d1a4 |
|
MD5 | 6b1bacfd009f51186b66081c17cd15dc |
|
BLAKE2b-256 | 71681e62135f2447dd2e6afe3bef1079056db562ef3f541ef457eb893af20901 |