Skip to main content

WoodMac's Faust Prometheus Library

Project description

Faust Prometheus

This library uses sensors of Faust. Those sensors are events based. Our monitor implements that interface and hooks some actions when those events happen. That allows us to create our own prometheus Counters, Gauges and Histograms. I created some predefined metrics, but we can expand on them in the future.

Installation

To use this library in your faust project just add faustprometheus or install it through pip:

pip install faustprometheus

Usage

Add PrometheusMonitor to the app as seen below:

    import faust
    from faustprometheus.monitor import PrometheusMonitor

    app = faust.App('example', broker='kafka://')
    app.monitor = PrometheusMonitor(app)

You can also configure some global options to monitor through PrometheusMonitorConfig, such as 2 levels of prefixes, through namespace and subsystem. The path exposing prometheus metrics can be set through metrics config, with /metrics as default value. I added labels to config, but are not applied to monitor due to lack of my understanding of faust sensors and prometheus.

    from faustprometheus.config import PrometheusMonitorConfig

    monitor_config = PrometheusMonitorConfig(
        path='/metrics',
        namespace='faust',
        subystem='foo-app',
        labels=['v2.3', 'prod']
        )        

Tests

Library is fully unit tested and can be run by

    pytest

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

faustprometheus-0.0.2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

faustprometheus-0.0.2-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file faustprometheus-0.0.2.tar.gz.

File metadata

  • Download URL: faustprometheus-0.0.2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for faustprometheus-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8c469c193d49dd611cfd5092074344d3e47a16608d2ef0955d437d143208270a
MD5 9feef534db253207db9574d94959ec1b
BLAKE2b-256 6c5e369ca2ab72fe3ff462c3ce477cc44b98eebe7f3eb81dcecb6c899a08fab8

See more details on using hashes here.

File details

Details for the file faustprometheus-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: faustprometheus-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for faustprometheus-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 639b1c10e64ca07f8e6a8d51e5582f8490449983fb8a1ce147916cef4be1803c
MD5 bc91244dd18e80dbb5c195160a2ccad0
BLAKE2b-256 ace07b1991640d90fd3be2ac13c809befade02197444e05143ce0f1ed16d136d

See more details on using hashes here.

Supported by

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