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_appcomposes lifespan toforce_flushon exit (shutdown stays on atexit for shared process providers).
Configs - OpenTelemetry¶
HttpUrlOTLP endpoints -OTLP_ENDPOINTand per-signal overrides use pydanticHttpUrlvalidation.- Config guards - Rejects
IS_ENABLEDwith all signals off and invalidLOGS_LEVELvalues.
Changed¶
Helpers - OpenTelemetry¶
- Transactional init - Providers are published only after all enabled signals
build successfully; partial failures shut down local providers and leave
_initializedfalse for retry. - Signal isolation - Decorators, FastAPI, gRPC, and exception capture honor
TRACES_ENABLED/METRICS_ENABLEDindependently; disabled FastAPI signals use explicit NoOp providers (neverNoneglobal 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
SpanKindimport. - Async cancellation -
CancelledErrorrecords metricstatus=cancelledand 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.