Prometheus extension for Emmett framework
Project description
Emmett-Prometheus
Emmett-Prometheus is an Emmett framework extension integrating prometheus client.
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.1.1.tar.gz
.
File metadata
- Download URL: emmett_prometheus-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.9 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b59ff821c1d6c21ce28d521a93b8d160b63b6f394608a06b02c7f062e75def0f |
|
MD5 | 89ea28210900e6b7ea0fb655ed4e1d31 |
|
BLAKE2b-256 | c38a11ab6234d9317b66eb09d9b1d3c0eb5a7b5e969e6dbb8de1b7d69ada31e7 |
File details
Details for the file emmett_prometheus-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: emmett_prometheus-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.9 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 361952c2ee3c474b5fbdd02a2b0ee12b5f61396546afb38707bad19a4969c059 |
|
MD5 | f4af10b6327ae862e82a62eb8ee41eda |
|
BLAKE2b-256 | d258d064650027a971f83e740d653ab66d8c94488092ed4fced57b6954ce57cc |