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.16.0

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.16.0
File Size Uploaded Provenance Actions
lite_bootstrap-1.16.0.tar.gz 1.8 MB Without provenance Details for lite_bootstrap-1.16.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.7 MB

Release files / lite_bootstrap-1.16.0.tar.gz

Download URL lite_bootstrap-1.16.0.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
d9e2a2ea49f902ea9d42958d182b729b9b00d87177485e845c23fce524277c80
BLAKE2b-256 checksum
How to use checksums
5b2eac6cd038a97ab1514d42e7b8e8abf6afa54b037504690a85529999ea8f0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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.16.0-py3-none-any.whl

Download URL lite_bootstrap-1.16.0-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
cf6c6ebaed97f287a3f2ee83e827680d224783a8d02c2985d2f6442f1ea2c0dc
BLAKE2b-256 checksum
How to use checksums
5932e372598a1ec873ca8ee0d7f651906d598e0cd8b710d3cc302db1320c0bb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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.16.0

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.16.0 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