Skip to main content

WoodMac 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.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: faustprometheus-0.0.1.tar.gz
  • Upload date:
  • Size: 8.2 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.1.tar.gz
Algorithm Hash digest
SHA256 11aafaefc7f3849e8fc471196132b9c052f2f7a6ef44e1c4231846be2a33eac5
MD5 506b0a22f9764cdbb16dafddbbdbe76b
BLAKE2b-256 6fedf8ab4f1b49ba5deff6aea33bce6c5073cf4fee60668daa710394dee522d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: faustprometheus-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23773c54e39f31b43648176d949777fc423e105eab62c43f0a6b558d2b022a2c
MD5 1ffd5b2da2d4364c3d5fba26b90523d2
BLAKE2b-256 39b5fc8f6349a846a9de37f4e9b55388d428660e276e94aca2e0dd356818eeb2

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