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

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.4
File Size Uploaded Provenance Actions
faststream_prometheus-0.1.4.tar.gz 5.1 kB Without provenance Details for faststream_prometheus-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 10.6 kB

Release files / faststream_prometheus-0.1.4.tar.gz

Download URL faststream_prometheus-0.1.4.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a675a6c278ec6178b94be19a0b373f43b5018369aeffb75de2022992160b5573
BLAKE2b-256 checksum
How to use checksums
09ede67e60657859655c9946a05237b3e3f4cc8baae5ae1d11265d9b58f60447
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.4-py3-none-any.whl

Download URL faststream_prometheus-0.1.4-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6fc98f1d11167366f90679fa0a59efc8eefdc2245226b40b077a34973e8275b
BLAKE2b-256 checksum
How to use checksums
65b34ebcf4372132e7487c395d8372483151b670451832c526319bf2d3d13f17
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.4

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