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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e14df3c37b772a4af89ed762884649c3c3aa4ecf2299e47e654f1d15cc51b0 |
|
MD5 | ad8c76943612519774315e2c9e7957a5 |
|
BLAKE2b-256 | 11bfa57bf781d3f55812fb51ab206e8777123051d00c020e56dbd9562bf9a556 |
Close
Hashes for prometheus_client_utils-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 939d018ace805bbb866a5b42b7b0a604d507047a62e1d42a128b1b48c305f4a9 |
|
MD5 | e8d219766447859c7b3dc825ea5cd3bf |
|
BLAKE2b-256 | 11e70b7d748808ce711d1e836e18e828adeec82a0631347da6d42396037ba65b |