Metadata-Version: 2.4
Name: py_metric_support
Version: 0.1.0
Summary: Prometheus metric support
Author-email: Igor Agafonov <igoradm90@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/IVAgafonov/py_metric_support
Project-URL: Issues, https://github.com/IVAgafonov/py_metric_support/issues
Keywords: python,prometheus,metrics
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: prometheus_client<1,>=0.22
Provides-Extra: test
Requires-Dist: pytest<9,>=8; extra == "test"
Dynamic: license-file

# py_metric_support

Prometheus metric helper.

## Install

```bash
pip install -e .
```

Or with requirements files:

```bash
pip install -r requirements.txt
pip install -r requirements-dev.txt
```

## Usage

```python
from py_metric_support import Measure, MetricSupport

MetricSupport.counter("requests_total", ("path", "/health")).inc()
MetricSupport.gauge("workers").set(4)
MetricSupport.gauge_on_scrape("build_info", "version", callback=lambda: Measure(1, "0.1.0"))

print(MetricSupport.to_prometheus())
print(MetricSupport.to_json_string())
```
