provide-telemetry
2026-03-13
Provider state gating, circuit breaker half-open, OTel context sync, and regression test suite
36 files · 1,617+ · 102-
Provider State Gating
5 files changed
provider.py`get_tracer()` now checks provider initialization state before returning; falls back to no-op if not initializedprovider.py`get_meter()` now checks provider initialization state before returning; falls back to no-op if not initializedapi.pyAPI layer updated to propagate state-gating behavior__init__.pyMetrics package init updated for state gatingtest_metrics_early_get_meter.pyReal-SDK lifecycle test verifying the full provider initialization flow
get_tracer()andget_meter()now check whether the OTel provider is properly initialized before returning; returns safe no-op tracer/meter if not initialized harden behavioral2 files
provider.pyprovider.py
- Real-SDK lifecycle test verifies the full provider initialization flow
qualify
internal
1 file
test_metrics_early_get_meter.py
Circuit Breaker Half-Open Recovery
2 files changed
resilience.pyCircuit breaker now implements half-open state; decoupled from metrics initializationcore.pyLogging subsystem decoupled from metrics subsystem initialization
- Logging subsystem no longer depends on metrics subsystem initialization
harden
behavioral
1 file
core.py
- Circuit breaker now implements half-open state: allows a probe request through after recovery window
harden
behavioral
1 file
resilience.py
OTel Trace Context Sync and Lazy SLO Loading
4 files changed
_otel.pyOTel trace context now synced into Python's contextvars for cross-coroutine propagation__init__.pySLO module made lazily loaded to reduce import costdecorators.pyTracing decorators updated for context synctest_trace_context_sync.pyTests verifying OTel context propagation into contextvars (145 lines)
- OpenTelemetry trace context now synced into Python’s
contextvarsfor cross-coroutine propagation instantiate behavioral2 files
_otel.pytest_trace_context_sync.py
- SLO module (
slo.py) made lazily loaded to reduce import cost streamline internal1 file
__init__.py
Bug Fixes from Code Review
8 files changed
setup.pyRace conditions and clean shutdown sequence fixedruntime.pyStale cache invalidation fixedsampling.pySampling subsystem correctness fixesconfig.pyConfig correctness fixesfallback.pyStale meter cache fixtest_code_review_regressions.pyRegression tests for race conditions, staleness, shutdown, and circuit breaker edge casestest_code_review_regressions_2.pySecond batch of code review regression teststest_code_review_regressions_3.pyThird batch of code review regression tests
- Fixed 6 code review issues: race conditions in concurrent telemetry access, stale cache invalidation, clean shutdown sequence, circuit breaker edge cases
remediate
behavioral
4 files
setup.pyruntime.pyresilience.pyfallback.py
- Fixed stale meter cache, hardened mutation coverage, improved test isolation
remediate
internal
2 files
fallback.pytest_dx_stability.py
Mutation Testing Survivor Kills
7 files changed
test_setup_mutations.pyBoundary tests and resolve name assertions to kill remaining mutation survivorstest_setup_lifecycle.pySetup lifecycle tests with frozen time for cooldown boundarytest_otel_integration.pyUpdated OTel integration teststest_logger_mutations.pyLogger mutation test updatestest_processors_mutations.pyProcessor mutation test updatestest_thread_safety.pyThread-safety tests updated for mutation coveragetest_middleware_cancellation.pyASGI middleware cancellation tests updated
Test Suite Expansion
8 files changed
test_code_review_regressions.pyCode review regression teststest_code_review_regressions_2.pySecond regression batchtest_code_review_regressions_3.pyThird regression batchtest_dx_stability.pyDX stability teststest_trace_context_sync.pyTrace context sync tests (145 lines)test_metrics_early_get_meter.pyEarly get_meter lifecycle teststest_openobserve_e2e.pyEnd-to-end OpenObserve teststest_metrics_core.pyMetrics core test updates
- New test subdirectories and files:
test_code_review_regressions.py(three files, ~1,000 lines total),test_dx_stability.py,test_trace_context_sync.py,test_metrics_early_get_meter.py, end-to-end OpenObserve tests qualify internal6 files
test_code_review_regressions.pytest_code_review_regressions_2.pytest_code_review_regressions_3.pytest_dx_stability.pytest_trace_context_sync.pytest_openobserve_e2e.py