Skip to content

5.0.4 — 2026-08-31

← 5.0.5 | 5.0.3 → | ↑ 5.x series

Added

Helpers - OpenTelemetry

  • force_flush / shutdown - Explicit, idempotent provider lifecycle APIs; atexit flush/shutdown owns process exit cleanup.
  • Fork-aware re-init - Detects PID change after preload+fork and rebuilds ArchiPy-owned providers without shutting down parent exporter threads.
  • Provider ownership - Distinguishes owned vs adopted global providers so shutdown never closes another library's Tracer/Meter/LoggerProvider.
  • FastAPI lifespan flush - AppUtils.create_fastapi_app composes lifespan to force_flush on exit (shutdown stays on atexit for shared process providers).

Configs - OpenTelemetry

  • HttpUrl OTLP endpoints - OTLP_ENDPOINT and per-signal overrides use pydantic HttpUrl validation.
  • Config guards - Rejects IS_ENABLED with all signals off and invalid LOGS_LEVEL values.

Changed

Helpers - OpenTelemetry

  • Transactional init - Providers are published only after all enabled signals build successfully; partial failures shut down local providers and leave _initialized false for retry.
  • Signal isolation - Decorators, FastAPI, gRPC, and exception capture honor TRACES_ENABLED / METRICS_ENABLED independently; disabled FastAPI signals use explicit NoOp providers (never None global fallback).
  • Shared gRPC OTel install - Sync/async interceptor setup shares one helper that requires a concrete tracer provider before insert.

Fixed

Helpers - OpenTelemetry

  • Missing-extra crash - After failed OTel import, tracing decorators no-op instead of raising on SpanKind import.
  • Async cancellation - CancelledError records metric status=cancelled and span ERROR instead of false success / UNSET.
  • Unsafe repr / secrets - Argument capture catches failing __repr__; sensitive static attributes are redacted; status descriptions are bounded.
  • Shut-down global adoption - Refuses to adopt providers already shut down (including ids tracked after ArchiPy shutdown).

Tests

Tests - OpenTelemetry

  • Lifecycle / failure paths - Partial exporter failure, borrowed providers, import-failed no-op, log export, post-fork rebuild, concurrent instruments, cancellation, config validation.
  • App wiring - Metrics-only FastAPI (no HTTP span), missing tracer skips gRPC interceptor, lifespan flush without tearing down shared providers.