Skip to main content

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

emmett_prometheus-0.3.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emmett_prometheus-0.3.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file emmett_prometheus-0.3.0.tar.gz.

File metadata

  • Download URL: emmett_prometheus-0.3.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for emmett_prometheus-0.3.0.tar.gz
Algorithm Hash digest
SHA256 724a187a67027bbaff43f97c6b2166a7fb767231414dad4058a0fd1ee574ac37
MD5 23090ab0db0507874f32f57d6070b85f
BLAKE2b-256 a1c73bae6e81b06142fb2d4bae749e34e928d0392f4054cd34c454511c6a89eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for emmett_prometheus-0.3.0.tar.gz:

Publisher: publish.yml on emmett-framework/prometheus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file emmett_prometheus-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for emmett_prometheus-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a49ed16b9272a4f88be34f7bc352e49603776a6be2a050f3f64102c0f099f36
MD5 0eb7c61e6805d192cbf7a9f66897912f
BLAKE2b-256 28e8234ec86dc34e9f14987c2914c204a37f396487e75809d3930f72fc2a7c08

See more details on using hashes here.

Provenance

The following attestation bundles were made for emmett_prometheus-0.3.0-py3-none-any.whl:

Publisher: publish.yml on emmett-framework/prometheus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page