provide-telemetry
2026-03-14
100% mutation kill score, 12 thread-safety fixes, and ASGI context restoration
42 files · 2,078+ · 211-
Reach 100% Mutation Kill Score
6 files changed
provider.pyIdentity-comparison refactor: uses `is` where object identity is intended to catch is/== mutationsprovider.pyMetrics provider identity comparison hardenedtest_external_provider_compat.pyExternal provider compatibility tests for OTel SDK interop (new file)test_otel_integration.pyOTel integration tests updated for full mutation coveragetest_trace_context_sync.pyTrace context sync tests expanded (188 lines)test_tracing_edge_cases.pyTracing edge-case tests updated
Thread Safety and Shutdown Fixes
13 files changed
setup.pyAtomicity gaps in provider state transitions fixed; shutdown_logging() sentinel flag now resets correctly on exceptionruntime.pyConcurrent access patterns hardenedprovider.pyConcurrent access patterns in metrics provider hardenedfallback.pyMetrics fallback thread safety improvementsresilience.pyResilience subsystem thread safety improvementssampling.pySampling subsystem thread safety improvementsbackpressure.py`_validate_signal()` added; replaces silent fallback-to-'logs' with explicit ValueError for unknown signal nameshealth.py`_VALID_SIGNALS` frozenset added; `_known_signal()` now raises rather than silently returning 'logs'propagation.pyPropagation thread safety improvementspii.pyPII subsystem thread safety improvementstest_code_review_regressions_4.pyFourth batch of code review regression tests covering thread-safety fixestest_code_review_regressions_4b.pySupplemental regression tests for thread-safety edge casestest_thread_safety.pyConcurrency thread-safety tests expanded
- Fixed atomicity gaps in provider state transitions — state now transitions atomically rather than in separable steps
remediate
behavioral
1 file
setup.py
- Fixed
reconfigure_telemetry()guard: blocks handler reinstall after OTel providers are shut down to prevent use-after-shutdown remediate behavioral1 file
setup.py
- Fixed
shutdown_logging()state leak: sentinel flag now resets correctly even whenprovider.shutdown()raises an exception (was left in inconsistent state on exception) remediate behavioral1 file
setup.py
- Hardened concurrent access patterns in metrics and tracing providers
harden
internal
2 files
provider.pyruntime.py
- Added
_validate_signal()inbackpressure.pyreplacing silent fallback-to-’logs’ with an explicit ValueError for unknown signal names harden behavioral1 file
backpressure.py
- Added
_VALID_SIGNALSfrozenset inhealth.pyand changed_known_signal()to raise rather than silently return ’logs’ (improves mutation detectability) harden behavioral1 file
health.py
ASGI Middleware Context Restoration
3 files changed
middleware.pyCaptures pre-request context; restores it after request rather than clearing, fixing nested ASGI call correctnesstest_middleware_and_setup.pyASGI middleware tests updated for context restoration behaviortest_middleware_cancellation.pyASGI cancellation tests updated
- ASGI middleware now captures
pre_request_ctx = get_context()before binding request context harden behavioral1 file
middleware.py
- Replaced
clear_context()in cleanup path withrestore_context(pre_request_ctx)— correctly restores prior context state rather than clearing it, which matters for nested ASGI calls remediate behavioral1 file
middleware.py
Config URL Decoding Fix
1 file changed
config.py`unquote()` now applied to header keys as well as values
Architecture Documentation Update
2 files changed
ARCHITECTURE.mdDocuments `reconfigure_telemetry()` constraint: provider-changing OTel reconfiguration requires process restart once real providers are installedREADME.mdREADME updated to reflect current architecture and constraints
- Documented
reconfigure_telemetry()constraint: provider-changing OTel reconfiguration requires process restart once real OTel providers are installed specify architectural2 files
ARCHITECTURE.mdREADME.md