opencensus-ext-flask
OpenCensus Flask Integration
What it is and what it does
OpenCensus Flask Integration is a middleware package that instruments Flask applications to collect distributed tracing data. It wraps incoming requests and exports trace spans to configured backends (such as Jaeger, Zipkin, or Google Cloud Trace), allowing you to track request flow across microservices and diagnose performance issues. The middleware integrates directly into Flask's request/response cycle and supports configuration of samplers and exporters via Flask's config dictionary.
The package depends on flask and opencensus as runtime dependencies. It is designed to be dropped into existing Flask applications with minimal code changes—typically just instantiating the middleware with your app instance. Configuration options allow you to exclude certain paths from tracing and customize sampling and export behavior.
Use it for:
- Instrument a Flask microservice to emit traces to a distributed tracing backend for end-to-end request visibility.
- Exclude health-check endpoints from tracing to reduce noise in trace data collection.
- Configure probabilistic sampling to control trace volume while maintaining observability of production traffic.
- Export Flask request traces to a centralized trace collector for multi-service debugging and latency analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds distributed tracing instrumentation to Flask applications via OpenCensus, capturing request traces and exporting them to configured backends.
No. The package is abandoned (no releases since 2023-03-10, repository archived as of 2025-06-12) and receives no maintenance or security updates. While it may work for legacy Flask applications already using it, new projects should adopt actively maintained alternatives for distributed tracing. Existing users should plan migration to a supported solution.
Install
opencensus-ext-flask on PyPI
pip
pip install opencensus-ext-flaskuv
uv add opencensus-ext-flaskpoetry
poetry add opencensus-ext-flaskInstalling opencensus-ext-flask
Before you install
Installation is straightforward with low friction. However, the package is in abandoned status with no releases since 2023-03-10 and the repository archived as of 2025-06-12, meaning no active maintenance or security updates.
License in practice
Licensed under Apache-2.0 (permissive), which allows commercial and private use with minimal restrictions—suitable for most projects, though you assume responsibility for any unpatched issues.
Quickstart
pip install opencensus-ext-flask
from flask import Flask
from opencensus.ext.flask.flask_middleware import FlaskMiddleware
app = Flask(__name__)
middleware = FlaskMiddleware(app, excludelist_paths=['_ah/health'])
@app.route('/')
def hello():
return 'Hello World!'
if __name__ == '__main__':
app.run(host='localhost', port=8080, threaded=True)
Verify before relying
- Compatibility with modern Flask and Python versions beyond those listed in classifiers (3.9 is the latest listed).
- Whether the abandoned status and archived repository affect real-world reliability or if the package remains stable for existing deployments.
- Current state of the opencensus backend ecosystem and whether exporters referenced in configuration examples are still maintained.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — flask, opencensus |
| Maintenance | abandoned — 1,253 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 74,143/month — #14,870 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opencensus_ext_flask-0.8.2-py2.py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
opencensusOpenCensus provides distributed tracing and…
permissive · top 1,000 on PyPI
opencensus-ext-requestsIntegrates OpenCensus distributed tracing with…
permissive · top 15,000 on PyPI
opencensus-ext-loggingEnriches Python log records with OpenCensus…
permissive · top 15,000 on PyPI
opencensus-contextProvides in-process context propagation for…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-flaskAdds distributed tracing to Flask web…
permissive · top 1,000 on PyPI
opencensus-ext-azureExports logs, metrics, and traces from Python…
permissive · top 5,000 on PyPI
opentracingProvides the OpenTracing API for Python,…
permissive · top 5,000 on PyPI
Flask-Log-Request-IDExtracts request IDs from incoming HTTP…
permissive · top 15,000 on PyPI
flask-request-id-headerFlask middleware that automatically adds or…
unclear · top 15,000 on PyPI