# Emmett-Prometheus
Emmett-Prometheus is an [Emmett framework](https://emmett.sh) extension integrating [prometheus](https://prometheus.io) client.
[![pip version](https://img.shields.io/pypi/v/emmett-prometheus.svg?style=flat)](https://pypi.python.org/pypi/emmett-prometheus)
## Installation
You can install Emmett-Prometheus using pip:
pip install emmett-prometheus
And add it to your Emmett application:
```python
from emmett_prometheus import Prometheus
app.use_extension(Prometheus)
```
## Configuration
Here is the complete list of parameters of the extension configuration:
| param | default | description |
| --- | --- | --- |
| auto\_load | `True` | Automatically inject extension on routes and expose metrics |
| enable\_http\_metrics | `True` | Enable metrics collection on HTTP routes |
| enable\_ws\_metrics | `True` | Enable metrics collection on Websocket routes |
| enable\_sys\_metrics | `False` | Enable default Prometheus client system metrics collection |
| metrics\_route\_path | /metrics | Path for metrics route |
| metrics\_route\_hostname | | Hostname for metrics route |
You also have some additional customisations available (here we show the defaults):
```python
app.config.Prometheus.http_histogram_statuses = [200, 201]
app.config.Prometheus.http_histogram_exclude_methods = ["OPTIONS"]
app.config.Prometheus.http_histogram_buckets = [
5, 35, 100, 200, 500, 1000, "INF"
]
app.config.Prometheus.exclude_routes = []
app.config.Prometheus.metrics_names={
"http_counter": "emmett_request_count",
"http_histogram": "emmett_request_latency",
"ws_gauge": "emmett_websocket_gauge",
"ws_recv_counter": "emmett_websocket_messages_recv_count",
"ws_send_counter": "emmett_websocket_messages_send_count"
}
```
## License
Emmett-prometheus is released under BSD license.
Raw data
{
"_id": null,
"home_page": "https://github.com/emmett-framework/prometheus",
"name": "emmett-prometheus",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "prometheus,monitoring,emmett",
"author": "Giovanni Barillari",
"author_email": "g@baro.dev",
"download_url": "https://files.pythonhosted.org/packages/14/9f/2b9d954b03d5f99429237538c0ace61fd97e9303adb5c59f353faf84cebd/emmett_prometheus-0.1.5.tar.gz",
"platform": null,
"description": "# Emmett-Prometheus\n\nEmmett-Prometheus is an [Emmett framework](https://emmett.sh) extension integrating [prometheus](https://prometheus.io) client.\n\n[![pip version](https://img.shields.io/pypi/v/emmett-prometheus.svg?style=flat)](https://pypi.python.org/pypi/emmett-prometheus) \n\n## Installation\n\nYou can install Emmett-Prometheus using pip:\n\n pip install emmett-prometheus\n\nAnd add it to your Emmett application:\n\n```python\nfrom emmett_prometheus import Prometheus\n\napp.use_extension(Prometheus)\n```\n\n## Configuration\n\nHere is the complete list of parameters of the extension configuration:\n\n| param | default | description |\n| --- | --- | --- |\n| auto\\_load | `True` | Automatically inject extension on routes and expose metrics |\n| enable\\_http\\_metrics | `True` | Enable metrics collection on HTTP routes |\n| enable\\_ws\\_metrics | `True` | Enable metrics collection on Websocket routes |\n| enable\\_sys\\_metrics | `False` | Enable default Prometheus client system metrics collection |\n| metrics\\_route\\_path | /metrics | Path for metrics route |\n| metrics\\_route\\_hostname | | Hostname for metrics route |\n\nYou also have some additional customisations available (here we show the defaults):\n\n```python\napp.config.Prometheus.http_histogram_statuses = [200, 201]\napp.config.Prometheus.http_histogram_exclude_methods = [\"OPTIONS\"]\napp.config.Prometheus.http_histogram_buckets = [\n 5, 35, 100, 200, 500, 1000, \"INF\"\n]\napp.config.Prometheus.exclude_routes = []\napp.config.Prometheus.metrics_names={\n \"http_counter\": \"emmett_request_count\",\n \"http_histogram\": \"emmett_request_latency\",\n \"ws_gauge\": \"emmett_websocket_gauge\",\n \"ws_recv_counter\": \"emmett_websocket_messages_recv_count\",\n \"ws_send_counter\": \"emmett_websocket_messages_send_count\"\n}\n```\n\n## License\n\nEmmett-prometheus is released under BSD license.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Prometheus extension for Emmett framework",
"version": "0.1.5",
"project_urls": {
"Homepage": "https://github.com/emmett-framework/prometheus",
"Issue Tracker": "https://github.com/emmett-framework/prometheus/issues",
"Repository": "https://github.com/emmett-framework/prometheus"
},
"split_keywords": [
"prometheus",
"monitoring",
"emmett"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "44aeef7a5c61862f18ef77a7e9c8decc188c3abd66e278a7bc166344c31b1a46",
"md5": "be9891ae69abb095648304af90378704",
"sha256": "fc474de44fbfd6aa1cec26e749186568c4130302eaeea8370d719526fe61c7cc"
},
"downloads": -1,
"filename": "emmett_prometheus-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "be9891ae69abb095648304af90378704",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 5916,
"upload_time": "2023-05-04T13:08:15",
"upload_time_iso_8601": "2023-05-04T13:08:15.602561Z",
"url": "https://files.pythonhosted.org/packages/44/ae/ef7a5c61862f18ef77a7e9c8decc188c3abd66e278a7bc166344c31b1a46/emmett_prometheus-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "149f2b9d954b03d5f99429237538c0ace61fd97e9303adb5c59f353faf84cebd",
"md5": "af359aad71074755c3b6a23884c174d1",
"sha256": "9768dfa0aba5eff18e2bf9947f9364e9431a561c7ddd48213924964af1583d00"
},
"downloads": -1,
"filename": "emmett_prometheus-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "af359aad71074755c3b6a23884c174d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 4158,
"upload_time": "2023-05-04T13:08:17",
"upload_time_iso_8601": "2023-05-04T13:08:17.397528Z",
"url": "https://files.pythonhosted.org/packages/14/9f/2b9d954b03d5f99429237538c0ace61fd97e9303adb5c59f353faf84cebd/emmett_prometheus-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-04 13:08:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "emmett-framework",
"github_project": "prometheus",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "emmett-prometheus"
}