https://github.com/klen/muffin-prometheus
Prometheus metrics exporter for Muffin framework
https://github.com/klen/muffin-prometheus
asgi curio muffin prometheus-exporter trio
Last synced: 2 months ago
JSON representation
Prometheus metrics exporter for Muffin framework
- Host: GitHub
- URL: https://github.com/klen/muffin-prometheus
- Owner: klen
- Created: 2021-04-12T16:14:29.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2024-07-31T16:23:28.000Z (about 1 year ago)
- Last Synced: 2025-05-28T21:44:28.853Z (4 months ago)
- Topics: asgi, curio, muffin, prometheus-exporter, trio
- Language: Python
- Homepage:
- Size: 78.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Contributing: .github/contributing.md
- Code of conduct: .github/code_of_conduct.md
- Codeowners: .github/codeowners
- Security: .github/security.md
Awesome Lists containing this project
README
Muffin-Prometheus
#################.. _description:
**Muffin-Prometheus** -- Prometheus_ metrics exporter for Muffin_ framework
.. _badges:
.. image:: https://github.com/klen/muffin-prometheus/workflows/tests/badge.svg
:target: https://github.com/klen/muffin-prometheus/actions
:alt: Tests Status.. image:: https://img.shields.io/pypi/v/muffin-prometheus
:target: https://pypi.org/project/muffin-prometheus/
:alt: PYPI Version.. image:: https://img.shields.io/pypi/pyversions/muffin-prometheus
:target: https://pypi.org/project/muffin-prometheus/
:alt: Python Versions.. _contents:
.. contents::
.. _requirements:
Requirements
=============- python >= 3.9
.. _installation:
Installation
=============**Muffin-prometheus** should be installed using pip: ::
pip install muffin-prometheus
.. _usage:
Usage
=====Initialize and setup the plugin:
.. code-block:: python
import muffin
import muffin_prometheus# Create Muffin Application
app = muffin.Application('example')# Initialize the plugin
# As alternative: prometheus = muffin_prometheus.Plugin(app, **options)
prometheus = muffin_prometheus.Plugin()
prometheus.setup(app, group_paths=['/api'])Options
-------=========================== =========================== ===========================
Name Default value Desctiption
--------------------------- --------------------------- ---------------------------
**metrics_url** ``"/dev/prometheus"`` HTTP Path to export metrics for Prometheus_
**group_paths** ``[]`` List of path's prefixes to group. A path which starts from the prefix will be grouped
=========================== =========================== ===========================You are able to provide the options when you are initiliazing the plugin:
.. code-block:: python
prometheus.setup(app, metrics_url='/metrics', group_paths=['/views', '/api/v1', '/api/v2'])
Or setup it inside ``Muffin.Application`` config using the ``PROMETHEUS_`` prefix:
.. code-block:: python
PROMETHEUS_METRICS_URL = '/metrics'
PROMETHEUS_GROUP_PATHS = ['/views', '/api/v1', '/api/v2']
``Muffin.Application`` configuration options are case insensitive
.. _bugtracker:
Bug tracker
===========If you have any suggestions, bug reports or annoyances please report them to
the issue tracker at https://github.com/klen/muffin-prometheus/issues.. _contributing:
Contributing
============Development of the plugin happens at: https://github.com/klen/muffin-prometheus
Contributors
=============* klen_ (Kirill Klenov)
.. _license:
License
========Licensed under a `MIT license`_.
.. _links:
.. _klen: https://github.com/klen
.. _Muffin: https://github.com/klen/muffin
.. _Prometheus: https://prometheus.io.. _MIT license: http://opensource.org/licenses/MIT