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.2

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.2
File Size Uploaded Provenance Actions
faststream_prometheus-0.1.2.tar.gz 4.8 kB Without provenance Details for faststream_prometheus-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 10.0 kB

Release files / faststream_prometheus-0.1.2.tar.gz

Download URL faststream_prometheus-0.1.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
af6045ba5b0b43e0801fc68d3dd86aefa0a2562bdd5203133752db49e69021de
BLAKE2b-256 checksum
How to use checksums
fdb1fd3bb19a18f6033e5352b60d7040a82d33fdd9de05e06ddc5a7803e8d9c0
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.2-py3-none-any.whl

Download URL faststream_prometheus-0.1.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a2569008fd87c98d9babf9872645a96a85b4d1044aac6a2b2e32cf766ecac11
BLAKE2b-256 checksum
How to use checksums
26977a92ded9ef2b33e9dbd9b1286d203c8267b177cae4561d153eba25eb79f1
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.2

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