Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
aiohttp-prometheus-exporter
Advanced tools
.. image:: https://img.shields.io/pypi/v/aiohttp_prometheus_exporter.svg :target: https://pypi.python.org/pypi/aiohttp_prometheus_exporter
.. image:: https://img.shields.io/travis/adriankrupa/aiohttp_prometheus_exporter.svg :target: https://travis-ci.org/adriankrupa/aiohttp_prometheus_exporter
.. image:: https://img.shields.io/pypi/pyversions/aiohttp_prometheus_exporter.svg :target: https://pypi.python.org/pypi/aiohttp_prometheus_exporter
.. image:: https://img.shields.io/pypi/dm/aiohttp_prometheus_exporter.svg :target: https://pypi.python.org/pypi/aiohttp_prometheus_exporter
.. image:: https://codecov.io/gh/adriankrupa/aiohttp_prometheus_exporter/branch/master/graph/badge.svg :target: https://codecov.io/gh/adriankrupa/aiohttp_prometheus_exporter
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Black
.. image:: https://readthedocs.org/projects/aiohttp-prometheus-exporter/badge/?version=latest :target: https://aiohttp-prometheus-exporter.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://pyup.io/repos/github/adriankrupa/aiohttp_prometheus_exporter/shield.svg :target: https://pyup.io/repos/github/adriankrupa/aiohttp_prometheus_exporter/ :alt: Updates
Export aiohttp metrics for Prometheus.io
Usage
Install with:
.. code-block:: shell
pip install aiohttp-prometheus-exporter
.. code-block:: python
from aiohttp import web
from aiohttp_prometheus_exporter.handler import metrics
from aiohttp_prometheus_exporter.middleware import prometheus_middleware_factory
async def hello(request):
return web.Response(text="Hello, world")
app = web.Application()
app.add_routes([web.get('/', hello)])
app.middlewares.append(prometheus_middleware_factory())
app.router.add_get("/metrics", metrics())
web.run_app(app)
.. code-block:: python
import aiohttp
from aiohttp_prometheus_exporter.trace import PrometheusTraceConfig
async with aiohttp.ClientSession(trace_configs=[PrometheusTraceConfig()) as session:
async with session.get('http://httpbin.org/get') as resp:
print(resp.status)
print(await resp.text())
Now, client metrics are attached to metrics exposed by your web server.
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage
: https://github.com/audreyr/cookiecutter-pypackage
FAQs
Prometheus exporter for aiohttp server and client.
We found that aiohttp-prometheus-exporter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.