--- id: flask-request-id-header version: "0.1.1" license: Open Government Licence v3.0 license_treatment: unclear maintenance: abandoned --- # flask-request-id-header — Python Flask middleware to ensure all requests have a request ID header License: unclear · Maintenance: abandoned · Downloads: 101.7K/mo ## What it is and what it does Flask Request ID Header is a lightweight middleware that ensures every HTTP request to a Flask application carries a unique X-Request-ID header. If a request arrives without one, the middleware generates a UUID v4 and adds it; if one exists but lacks a UUID v4 value, the middleware appends one. This enables request tracing across microservices, load balancers, and reverse proxies—critical for correlating log entries and debugging distributed systems. The middleware integrates directly into Flask's request handling with no required configuration. It exposes the current request ID via the request environment (HTTP_X_REQUEST_ID) so your application code can access it for logging or forwarding. You can optionally set a REQUEST_ID_UNIQUE_VALUE_PREFIX config to treat certain prefixed IDs as already unique, preventing unnecessary appends. The package is minimal and stable but unmaintained since 2019. Use it for: - Trace a single user request through multiple microservices by including the X-Request-ID in logs at each layer. - Correlate errors in a load-balanced Flask deployment by extracting the request ID from response headers. - Include request IDs in application logs using a custom logging formatter to link log entries to specific user actions. - Pass request IDs downstream to external APIs or databases to maintain end-to-end request context in distributed systems. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Flask middleware that automatically adds or validates an X-Request-ID header on all incoming requests, enabling request tracing through distributed systems. Yes, if you need a minimal, zero-configuration request ID middleware for a Flask application and can accept that the package is unmaintained. It has no known vulnerabilities, low install friction, and a simple, stable API. No, if you require active maintenance, support for recent Flask versions, or a more feature-rich tracing solution. Verify the Open Government Licence v3.0 is acceptable for your use case. ## Install pip install flask-request-id-header uv add flask-request-id-header poetry add flask-request-id-header ## Installing flask-request-id-header Before you install: Installation is straightforward with low friction—only flask as a runtime dependency. However, the package is abandoned: last release was 2019-03-02, last commit 2022-12-27, and no maintenance activity since. Use only if you need a minimal, stable request ID middleware and can maintain it yourself if needed. License in practice: Licensed under Open Government Licence v3.0 with unclear SPDX mapping. Verify compatibility with your project's license requirements before use, particularly in proprietary or commercial contexts. Quickstart: pip install flask-request-id-header from flask import Flask from flask_request_id_header.middleware import RequestID app = Flask(__name__) RequestID(app) @app.route('/') def hello(): return 'hello' Verify before relying: - Whether Open Government Licence v3.0 is compatible with your project's licensing model - Whether the package works with current Flask versions (last tested in 2019) - Whether UUID v4 generation for request IDs meets your security and uniqueness requirements ## Package facts - License: Open Government Licence v3.0 (unclear) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 101.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flask request id middleware, correlation id tracking flask, x-request-id header, request tracing flask, distributed request tracking, request-tracing, middleware, correlation-ids [View on SkillFed](https://skillfed.io/packages/flask-request-id-header) · [View on PyPI](https://pypi.org/project/flask-request-id-header/)