Coder Social home page Coder Social logo

prometheus's Introduction

Emmett-Prometheus

Emmett-Prometheus is an Emmett framework extension integrating prometheus client.

pip version

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.

prometheus's People

Contributors

gi0baro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.