Skip to main content

Prometheus metrics collector and exporter for nameko microservice framework

Project description

docs

Documentation Status

tests

Travis-CI Build Status

package

PyPI Package latest release PyPI Wheel Supported versions Supported implementations
Commits since latest release

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.serve(request)

Documentation

https://nameko-prometheus.readthedocs.io/

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

Authors

nameko-prometheus is developed and maintained by Emplocity.

License

This work is released under the Apache 2.0 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

nameko-prometheus-0.1.tar.gz (13.7 kB view hashes)

Uploaded Source

Built Distribution

nameko_prometheus-0.1-py2.py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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