skillfed

opencensus-ext-flask

OpenCensus Flask Integration

opencensus-ext-flask v0.8.2 74.1K downloads/30d#14,870 on PyPI676
Permissive license Apache-2.0 Abandoned released

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-flask

uv

uv add opencensus-ext-flask

poetry

poetry add opencensus-ext-flask

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

flask tracing middlewaredistributed tracing flaskopencensus flask integrationrequest tracing instrumentationflask request monitoringtrace exporter flaskapplication performance tracing
distributed-tracingobservabilityabandoned

More Monitoring packages