Prometheus metrics collector and exporter for nameko microservice framework
Project description
docs |
|
---|---|
tests |
|
package |
nameko-prometheus is a dependency for the nameko microservice framework which allows application metrics collection with Prometheus.
Features
automatic collection of request latency metrics for RPC and HTTP endpoints
HTTP endpoint exposing metrics to be scraped by Prometheus
Installation
pip install nameko-prometheus
You can also install the in-development version with:
pip install https://github.com/emplocity/nameko-prometheus/archive/master.zip
Usage
from nameko.rpc import rpc
from nameko.web.handlers import http
from nameko_prometheus import PrometheusMetrics
class MyService:
metrics = PrometheusMetrics(prefix="myservice")
@rpc
def say_hello(self):
return "Hello!"
@http("GET", "/")
def index(self, request):
return "OK"
@http("GET", "/metrics")
def serve_metrics(self, request):
return self.metrics.expose_metrics(request)
Documentation
Development
To run the all tests run:
tox
Note, to combine the coverage data from all the tox environments run:
Windows |
set PYTEST_ADDOPTS=--cov-append tox |
---|---|
Other |
PYTEST_ADDOPTS=--cov-append tox |
Development roadmap
Things we’d like to have in the future:
automatic registration of /metrics HTTP endpoint
decorator to exclude specific methods from tracing
License
This work is released under the Apache 2.0 license.
Project details
Release history Release notifications | RSS feed
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
Hashes for nameko_prometheus-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ca3ac1836159a3a7228d2717edf4e8f9a7b6c7279a9700c5ccc3b48a8a677c0 |
|
MD5 | e5bd2858a1c9a1283883afa56be36ea7 |
|
BLAKE2b-256 | b7e6dd7cf9fe53666cf32cef433e4c0d274209cb701ccee25d7988e36ab1d359 |