Skip to content

fix: keep Litestar telemetry active through user shutdown hooks - #466

Merged
lesnik512 merged 1 commit into
mainfrom
fix/litestar-shutdown-order
Nov 18, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/litestar-shutdown-order

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Shutdown hooks added to AppConfig after bootstrapper construction ran after telemetry teardown, losing their spans. Register teardown on the constructed Litestar app so it follows the final configuration’s user hooks.

Add an exporter regression covering the late-added hook, user lifespan and hook ordering, error propagation, and automatic teardown when a lifespan or shutdown hook raises.

Validation: the exporter regression failed before the fix. All 691 tests pass with 100% line coverage; Ruff and ty pass. All 67 Litestar bootstrap tests pass on Litestar 2.25.0 and the 2.22.0 minimum. Standards and spec reviews found no issues.

Closes #456.

@lesnik512
lesnik512 merged commit b9ef23f into main Nov 18, 2026
35 checks passed
@lesnik512
lesnik512 deleted the fix/litestar-shutdown-order branch November 18, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P3] Keep Litestar telemetry active for shutdown hooks added before app construction

1 participant