Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

FastStream Prometheus Collector

FastStream Based Metrics Collection for Prometheus

PyPI PyPI - Python Version GitLab last commit Docs

Test coverage Downloads GitLab stars

Functionality

  • Collection metrics via middleware
  • Collecting general metrics
  • Collecting details kafka metrics

Installation

pip install faststream-prometheus

Quick start

See example for details

import uvicorn
from fastapi import FastAPI
from faststream.kafka.fastapi import KafkaRouter
from prometheus_fastapi_instrumentator import Instrumentator

# Import Faststream Middleware for collect metrics 
from faststream_prometheus import FaststreamPrometheusMiddleware

# Adding middleware 
faststream_router = KafkaRouter(
    'localhost:9092',
    middlewares=[FaststreamPrometheusMiddleware(prefix='test_faststream')],
)

# Setup export metrics via FastAPI -> HTTP GET /metrics
app = FastAPI(lifespan=faststream_router.lifespan_context)
app.include_router(faststream_router)

instrumentator = Instrumentator().instrument(app, metric_namespace='fastapi').expose(app)
# see default metrics
curl localhost:8000/metrics

Contribute

Issue Tracker: https://gitlab.com/rocshers/python/faststream-prometheus/-/issues
Source Code: https://gitlab.com/rocshers/python/faststream-prometheus

Before adding changes:

make install-dev

After changes:

make format test

Metadata

Release files for faststream-prometheus 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faststream-prometheus 0.1.3
File Size Uploaded Provenance Actions
faststream_prometheus-0.1.3.tar.gz 4.9 kB Without provenance Details for faststream_prometheus-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for faststream-prometheus 0.1.3
File Interpreter ABI Platform Actions
faststream_prometheus-0.1.3-py3-none-any.whl Python 3 none any Details for faststream_prometheus-0.1.3-py3-none-any.whl

Total release size: 10.1 kB

Release files / faststream_prometheus-0.1.3.tar.gz

Download URL faststream_prometheus-0.1.3.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d5695af979a19feb2c0722c828f1de866fa48377ae2e4e42cb7fa2adde94d368
BLAKE2b-256 checksum
How to use checksums
84de6603a6a85136e27db7268669e0d219b7ab5725e4ea3ae075a93a96639553
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.19 Linux/6.8.0-40-generic

Release files / faststream_prometheus-0.1.3-py3-none-any.whl

Download URL faststream_prometheus-0.1.3-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21edeb4e36ec04828d0ce59d149bdd8838d57bec3bb91806b3e1c9399ffa54ca
BLAKE2b-256 checksum
How to use checksums
296d1c20e6f0bf380f27b77b70b04035b8489e4bf610088c6fa9272e76ae31d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.19 Linux/6.8.0-40-generic

Security for faststream-prometheus 0.1.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page