Skip to main content

lite-bootstrap

PyPI version Supported Python versions Downloads Coverage CI License GitHub stars Context7 uv Ruff ty

lite-bootstrap wires production observability (OpenTelemetry, Prometheus, Sentry, and structlog) into FastAPI, Litestar, FastStream, and FastMCP services in a few lines.

With lite-bootstrap, you receive an application with lightweight built-in support for:

  • sentry
  • prometheus
  • opentelemetry
  • pyroscope, with OpenTelemetry trace-profile linking
  • structlog
  • cors
  • swagger, including an offline version
  • health-checks

Those instruments can be bootstrapped for:

Lifecycle constraints

A few constraints that aren't obvious from the API:

  • One bootstrapper per application instance. Constructing two FastAPIBootstrappers around the same fastapi.FastAPI (or two FastMcpBootstrappers around the same FastMCP) is not supported. The second bootstrapper warns at construction, and its bootstrap() raises ConfigurationError.
  • One OpenTelemetryInstrument per process. bootstrap() calls opentelemetry.trace.set_tracer_provider(...), which the OTel SDK enforces as set-once: later calls log a warning and have no effect. teardown() flushes spans and closes exporters but can't reset the process-global pointer.
  • teardown() is idempotent. BaseBootstrapper.teardown() short-circuits if not bootstrapped; per-instrument teardown methods are safe to call multiple times.
  • Partial teardown failures are aggregated. If an instrument's teardown raises, the bootstrapper continues with the rest of the instruments and raises TeardownError at the end with all collected failures.

Usage examples:

Acknowledgements

lite-bootstrap is inspired by microbootstrap, a single package that wires up the common observability stack (sentry, prometheus, opentelemetry, logging, cors, swagger, health-checks) for FastAPI / Litestar / FastStream services and for plain scripts.

The following ideas were borrowed:

  • the overall surface: a Bootstrapper per framework that composes a set of instruments,
  • the lifecycle model: each instrument has bootstrap() / teardown() / is_ready() and is skipped when its optional dependency is not installed,
  • the catalog of supported instruments and supported frameworks.

The following intentionally differ:

  • Configuration. lite-bootstrap uses frozen dataclass configs with no pydantic / pydantic-settings runtime dependency, which is what makes it "lite". microbootstrap configures everything through pydantic-settings models.
  • Extras. lite-bootstrap has one mandatory runtime dependency, the pure-Python typing-extensions. Every instrument (sentry, otl, logging, pyroscope) and every framework (fastapi, litestar, faststream, fastmcp) is its own extra, plus an opt-in orjson speedup for logging, per-pair combos (fastapi-sentry, litestar-otl, faststream-metrics, …) and *-all rollups. microbootstrap bundles the full observability stack (opentelemetry, sentry-sdk, structlog, pyroscope-io, rich, pydantic-settings, …) as base dependencies and only splits framework packages into extras.
  • Free-threading. lite-bootstrap runs on free-threaded CPython 3.14t and 3.15t. Every extra whose dependencies are pure Python installs there. The rest are blocked upstream: orjson and pyroscope have no free-threaded wheels, and otl needs grpcio, so use otl-http instead.
  • Scope. lite-bootstrap only wires instruments. It does not include a Granian server runner or a console writer.

Part of modern-python

Browse the full list of templates and libraries in modern-python; the org profile has the categorized index.

Metadata

Release files for lite-bootstrap 1.15.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lite-bootstrap 1.15.1
File Size Uploaded Provenance
lite_bootstrap-1.15.1.tar.gz 1.8 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lite-bootstrap 1.15.1
File Interpreter ABI Platform
lite_bootstrap-1.15.1-py3-none-any.whl Python 3 none any Details

Total release size: 3.7 MB

Release files / lite_bootstrap-1.15.1.tar.gz

Download URL lite_bootstrap-1.15.1.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
b700dacda3cca5a0a3ef39d1039c62018d265ceb6ba34ef71b57ee9c97dece3b
BLAKE2b-256 checksum
How to use checksums
8f0ef4ab18f84b2482be1ded5c9f64375d08f2094d5928411b6f17e5f0c243d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lite_bootstrap-1.15.1-py3-none-any.whl

Download URL lite_bootstrap-1.15.1-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
14ae532fb5b11b2dfed816e8805f45168f8f6c2b03d6e4c3ed3453d72069e952
BLAKE2b-256 checksum
How to use checksums
87e4911365059e7975d1fd507dbe6b7e8f61d8abe0aa4e66b0ce849fad475b09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lite-bootstrap 1.15.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.15.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page