Prometheus extension for Emmett framework
Project description
Emmett-Prometheus
Emmett-Prometheus is an Emmett framework extension integrating prometheus client.
Emmett-Prometheus is compatible both with Emmett and Emmett55.
Installation
You can install Emmett-Prometheus using pip:
pip install emmett-prometheus
And add it to your Emmett application:
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):
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file emmett_prometheus-0.2.0.tar.gz
.
File metadata
- Download URL: emmett_prometheus-0.2.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c90e468c51bc43914ee09c11a47f812023dd2c3cbcc4e7c14d2ef92ddc4a45de |
|
MD5 | bef9f1536e87173676be3b649d406d53 |
|
BLAKE2b-256 | cc0dc66e59e7ae1877ddfc762b8af7379574e1e740ba785855a298cd9d0a6988 |
File details
Details for the file emmett_prometheus-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: emmett_prometheus-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3732ad877a894cef75ac93bd079c1a661dcb71755c938357fcb507bd59c5734c |
|
MD5 | 9c526c849e37742a714b613f33335b37 |
|
BLAKE2b-256 | 1f1a55586c1b134ffabcc96768dc709cb94ef25cabbd70a0aa10c97a20508a0a |