Skip to content

pico-otel v0.1.0

Latest

Choose a tag to compare

@dperezcabrera dperezcabrera released this 04 Jul 15:26

pico-otel v0.1.0

First public release. OpenTelemetry auto-instrumentation for pico-boot apps: install it and you get distributed tracing, Prometheus metrics and log correlation — wired by entry points, zero integration code. No prior versions; no migration required.

Highlights

  • Idempotent SDK setup at container startup (first configuration wins; safe with multiple containers per process).
  • Exporter modes: auto (OTLP when otel.endpoint is set, console otherwise), otlp, console, none — dev-to-prod is one yaml line.
  • Auto-instrumentation, import-guarded and mapped 1:1 to extras: FastAPI, SQLAlchemy, Celery, logging. You pay in dependencies only for what you instrument.
  • The pico-actuator contract: metrics export to prometheus_client's default registry — the one /actuator/metrics serves. Installing both = probes + metrics + tracing with zero config.
  • FastAPI instrumentation via a structural FastApiConfigurer — pico-otel never imports pico-fastapi.

Example

# application.yaml — everything below is optional
otel:
  service_name: my-service
  endpoint: http://otel-collector:4317   # switches export to OTLP

Compatibility

  • Python 3.11+ · pico-ioc >= 2.2.0 · opentelemetry-sdk >= 1.25
  • Extras: [otlp] [prometheus] [fastapi] [sqlalchemy] [celery] [logging] [all]

Tests

  • 5 tests. Pinned behaviors: SDK provider carries service.name, spans are recorded and exported, setup is idempotent (a second container reuses the first configuration), FastAPI requests produce spans through the structural configurer, and OTel metrics land in prometheus_client's default registry.

Install

pip install pico-otel[all]
# or select extras: [otlp] [prometheus] [fastapi] [sqlalchemy] [celery] [logging]