FastAPI has released version 0.142.2, a focused patch that resolves a startup-blocking issue related to OpenTelemetry auto-configuration. If the automatic OpenTelemetry setup failed, the application would crash on startup. This release ensures that a failure in that optional instrumentation path no longer prevents your FastAPI app from booting.
The fix was contributed by @tiangolo in PR #16418. Here’s what changed:
- Allow startup when automatic OpenTelemetry configuration fails: If the auto-configuration of OpenTelemetry raises an error, FastAPI now continues to start normally instead of aborting. This applies to the automatic instrumentation that FastAPI applies when OpenTelemetry dependencies are present.
- No new APIs, flags, or configuration options are introduced; the change is purely a resilience fix in the startup path.
Before this patch, developers using OpenTelemetry with FastAPI could find their entire service down due to an instrumentation misconfiguration — for example, a missing exporter endpoint, invalid credentials, or an incompatible package version. The failure occurred during application initialization, so the app never became available to serve requests. With 0.142.2, such failures are isolated: the app starts, and OpenTelemetry simply isn’t active (or is partially active) until the underlying issue is resolved. This is especially valuable in containerized environments, where a crash loop can be costly and hard to debug.
If you rely on OpenTelemetry for observability, you should still fix any configuration errors so you collect telemetry. But now a temporary misstep won’t take your API offline. The release is a drop-in upgrade — no code changes required. To apply it, update your dependency pin and reinstall:
pip install --upgrade fastapi==0.142.2
or update your requirements.txt to fastapi==0.142.2. This patch is a clear reminder that optional integrations should never compromise core availability.
Source: https://github.com/fastapi/fastapi/releases/tag/0.142.2