NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2001 most downloaded on PyPI
Middleware correlating project logs to individual requests
Last release 3 months ago
09 Jun 2026
Ships unpredictably
gaps range from 8 days to 1.6 years
Most releases are documented
notes for 23 of 30 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
31 releases · first in 2021
One column per quarter.
Removes an undocumented dependency on the packaging package, for users of the sentry integration (fixed in e543a49 ).
packaging package, for users of the sentry integration (fixed in e543a49).Full Changelog: v5.0.0...v5.0.1
…trace IDs ( #108 , reverting #92 ). This is a breaking change for users relying on strict UUID v4 validation — pass a custom validator to restore the…
$request_id and OpenTelemetry trace IDs (#108, reverting #92). This is a breaking change for users relying on strict UUID v4 validation — pass a custom validator to restore the old behavior.uv, ty, and ruff for packaging, linting, and formattingFull Changelog: v4.3.4...v5.0.0
Add packaging, used in sentry integration by @atanas-balevsky in #97
Full Changelog: v4.3.3...v4.3.4
Fix deprectation warnings in sentry-sdk 2.x by @imSniff in #95
fix: Correct uuidv4 check by @sondrelg in #92
Change license to MIT by @fabioruicci in #84
Full Changelog: v4.3.0...v4.3.1
This version drops official support for 3.7, and add support for 3.12. The middleware is expected to still work on 3.7 for now, but the version will n
This version drops official support for 3.7, and add support for 3.12. The middleware is expected to still work on 3.7 for now, but the version will no longer be guaranteed to work in the future.
Full Changelog: v4.2.0...v4.3.0
add correlation_id into websocket request by @Misutes in #74
Add support for log filter default value by @tlinhart in #70
Full Changelog: v4.0.0...v4.1.0
Remove Access-Control-Expose-Headers response header by @tlinhart in #67
Remove Access-Control-Expose-Headers response header by @tlinhart in #67
This PR removes Access-Control-Expose-Headers CORS headers from outgoing responses. See this section of the README for how to (re)configure your CORS middleware, if needed.
Change the default value of update_request_header by @sondrelg in #68
This change switches the default value of update_request_header to True, which seems like a more sensible default.
Full Changelog: v3.3.0...v4.0.0
Add support for updating request header values by @tlinhart in https://github.com/snok/asgi-correlation-id/pull/65
Full Changelog: https://github.com/snok/asgi-correlation-id/compare/v3.2.2...v3.3.0
chore: Add celery extra option by @sondrelg in https://github.com/snok/asgi-correlation-id/pull/63
Full Changelog: https://github.com/snok/asgi-correlation-id/compare/v3.2.1...v3.2.2
chore: allow newer starlette versions by @JonasKs in https://github.com/snok/asgi-correlation-id/pull/58
Full Changelog: https://github.com/snok/asgi-correlation-id/compare/v3.2.0...v3.2.1
Contextvars added to package __init__ by @Bobronium in https://github.com/snok/asgi-correlation-id/pull/54
__init__ by @Bobronium in https://github.com/snok/asgi-correlation-id/pull/54Full Changelog: https://github.com/snok/asgi-correlation-id/compare/v3.1.0...v3.2.0
docs: Add docs for how to integrate with saq by @sondrelg in https://github.com/snok/asgi-correlation-id/pull/47
Full Changelog: https://github.com/snok/asgi-correlation-id/compare/v3.0.1...v3.1.0
Adds starlette to the package's dependencies
Adds starlette to the package's dependencies (#44)
Reworked the middleware settings
Reworked the middleware settings (#39)
Reworded a warning logger (https://github.com/snok/asgi-correlation-id/commit/1883b31b0b115b2e6706c03f9bf94fadfeebca7a). This could potentially break log filters or monitoring dashboard, though is probably a non-issue for most.
The validate_header_as_uuid middleware argument was removed.
If your project uses validate_header_as_uuid=False, this is how the middleware configuration should change:
app.add_middleware(
CorrelationIdMiddleware,
header_name='X-Request-ID',
- validate_header_as_uuid=False
+ validator=None,
)
Otherwise, just make sure to remove validate_header_as_uuid if used.
Read more about the new configuration options here.
Nothing published for this version
Old log filter factories were removed. All users will need to follow the migration guide below to upgrade.
Breaking changes
Non-breaking changes
The celery_tracing_id_filter and correlation_id_filter callables have been removed in the latest release.
To upgrade, change from this log filter implementation:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'correlation_id': {'()': correlation_id_filter(uuid_length=32)},
'celery_tracing': {'()': celery_tracing_id_filter(uuid_length=32)},
},
...
}
To this one:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'correlation_id': {
'()': 'asgi_correlation_id.CorrelationIdFilter',
'uuid_length': 32,
},
'celery_tracing': {
'()': 'asgi_correlation_id.CeleryTracingIdsFilter',
'uuid_length': 32,
},
},
...
}
When upgrading a project which only implemented correlation_id_filter, you should expect this diff:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
- 'correlation_id': {'()': correlation_id_filter(uuid_length=32)},
+ 'correlation_id': {
+ '()': 'asgi_correlation_id.CorrelationIdFilter',
+ 'uuid_length': 32,
+ },
},
...
}
See the repository README for updated documentation.
Hotfix header issue introduced in v1.1.3
Fixes
Fix bug where headers would get overwritten by the middleware (#25). Thanks @lakshaythareja and @uncovor 👏
Fixes
Fix bug where headers would get overwritten by the middleware (#25). Thanks @lakshaythareja and @uncovor 👏
Fix log filter max uuid-length issue cropping incoming valid UUIDs to 32/36 chars (#14). Thanks @matusvalo 👏
Fix log filter max uuid-length issue cropping incoming valid UUIDs to 32/36 chars (#14). Thanks @matusvalo 👏
Nothing published for this version
Make the middleware compatible with Python ^3.6.1
Make the middleware compatible with Python ^3.6.1 (https://github.com/snok/asgi-correlation-id/pull/4)
Fixed an issue where extension imports were causing middleware to break when extension libraries weren't installed.
Fixed an issue where extension imports were causing middleware to break when extension libraries weren't installed.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →