Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piotrmaslanka/flask-satella-metrics
A library that metrics Flask calls with Satella's metrics
https://github.com/piotrmaslanka/flask-satella-metrics
Last synced: about 1 month ago
JSON representation
A library that metrics Flask calls with Satella's metrics
- Host: GitHub
- URL: https://github.com/piotrmaslanka/flask-satella-metrics
- Owner: piotrmaslanka
- License: mit
- Created: 2020-02-11T19:19:20.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-25T13:58:23.000Z (about 4 years ago)
- Last Synced: 2024-04-26T05:43:15.363Z (7 months ago)
- Language: Python
- Size: 29.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
flask-satella-metrics
=====================[![Build Status](https://travis-ci.org/piotrmaslanka/flask-satella-metrics.svg)](https://travis-ci.org/piotrmaslanka/flask-satella-metrics)
[![Test Coverage](https://api.codeclimate.com/v1/badges/34b392b61482d98ad3f0/test_coverage)](https://codeclimate.com/github/piotrmaslanka/flask-satella-metrics/test_coverage)
[![Code Climate](https://codeclimate.com/github/piotrmaslanka/flask-satella-metrics/badges/gpa.svg)](https://codeclimate.com/github/piotrmaslanka/flask-satella-metrics)
[![Issue Count](https://codeclimate.com/github/piotrmaslanka/flask-satella-metrics/badges/issue_count.svg)](https://codeclimate.com/github/piotrmaslanka/flask-satella-metrics)
[![PyPI](https://img.shields.io/pypi/pyversions/flask-satella-metrics.svg)](https://pypi.python.org/pypi/flask-satella-metrics)
[![PyPI version](https://badge.fury.io/py/flask-satella-metrics.svg)](https://badge.fury.io/py/flask-satella-metrics)
[![PyPI](https://img.shields.io/pypi/implementation/flask-satella-metrics.svg)](https://pypi.python.org/pypi/flask-satella-metrics)flask-satella-metrics is an application to seamlessly measure your Flask
application using Satella's metrics.Example use:
```python
import flask
from flask_satella_metrics import SatellaMetricsMiddleware
app = flask.Flask(__name__)
SatellaMetricsMiddleware(app)
```And to launch a Prometheus exporter use the following snippet:
```python
from satella.instrumentation.metrics.exporters import PrometheusHTTPExporterThread
phet = PrometheusHTTPExporterThread('0.0.0.0', 8080, {'service_name': 'my_service'})
phet.start()
```Or, if you desire to export your metrics within Flask, just use:
```python
import flask
from flask_satella_metrics.prometheus_exporter import PrometheusExporter
app = flask.Flask(__name__)
app.register_blueprint(PrometheusExporter({'service_name': 'my_service'}))
```