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',
subsystem='foo-app',
labels=['v2.3', 'prod']
)
Tests
Library is fully unit tested and can be run by
pytest
Metadata
Release files for faustprometheus 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| faustprometheus-0.0.6.tar.gz | 9.2 kB | Without provenance | Details for faustprometheus-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| faustprometheus-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for faustprometheus-0.0.6-py3-none-any.whl |
Total release size: 19.7 kB
Release files / faustprometheus-0.0.6.tar.gz
| Download URL | faustprometheus-0.0.6.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b005b4ebc0e08befad6ad1d251eb88286dd2fd24ae793d92c9c1fa905eaa6143
|
|
BLAKE2b-256 checksum How to use checksums |
30a3390f5cc2fed65e29d93e76593a508d661974b80037181cf27788c361e5f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / faustprometheus-0.0.6-py3-none-any.whl
| Download URL | faustprometheus-0.0.6-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
197eace4b7abcdb37d45647f32aeb4df59bccdcdd76fe2ceef55341d89b78f6e
|
|
BLAKE2b-256 checksum How to use checksums |
b0006a9af05250ffe117829689dfb71d7d22e57e6bcb43ac80c3b913070457e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.10
|
Security for faustprometheus 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.