provide-telemetry
2026-03-22
Per-module log level overrides, FilteringBoundLogger, executor saturation tests, TypeScript examples
47 files · 8,962+ · 51-
Per-module log level overrides via UNDEF_LOG_MODULE_LEVELS
6 files changed
config.pyAdded module_levels field to LoggingConfig; added _parse_module_levels() helper that parses 'module=LEVEL,module2=LEVEL2' from UNDEF_LOG_MODULE_LEVELS env var into a normalized dictprocessors.pyAdded _LevelFilter structlog processor with longest-prefix matching: drops events below the configured threshold for their module; added make_level_filter() factory; added _FAST_LEVEL_LOOKUP dict for O(1) level-name → numeric conversioncore.pyAdded _LEVEL_NAME_TO_NUMERIC map; wires make_level_filter() into the processor chain when module_levels is non-empty; added _make_filtering_bound_logger() that extends structlog.make_filtering_bound_logger with .trace(), .is_debug_enabled(), .is_trace_enabled(), and a permissive no-op for filtered levels__init__.pyUpdated exportstest_level_filter.py223-line test file covering _LevelFilter prefix matching, default vs override thresholds, exact and prefix matches, TRACE level, and edge casestest_logger_mutations.pyExtended mutation test suite for per-module level override paths; 100% branch coverage and mutation kill score enforced
- UNDEF_LOG_MODULE_LEVELS=‘asyncio=WARNING,undef.server=DEBUG’ configures per-module thresholds. _LevelFilter performs longest-prefix matching on the logger name field in each event dict — e.g. ‘undef.server.rpc’ matches ‘undef.server’ before ‘undef’. Events below the matching threshold are dropped before output.
instantiate
behavioral
3 files
config.pyprocessors.pycore.py
- _make_filtering_bound_logger() extends structlog’s FilteringBoundLogger with .trace() (routes through .debug(_trace=True)), .is_debug_enabled() and .is_trace_enabled() O(1) level checks for guarding expensive argument construction, and a permissive no-op for filtered-out log methods that accepts arbitrary args/kwargs.
instantiate
behavioral
1 file
core.py
Executor saturation load tests
3 files changed
test_executor_saturation.py222-line load test suite covering three failure modes under sustained export failures: ghost thread accumulation (circuit breaker bounds growth), circuit breaker lifecycle (trip→block→half-open→reset→re-trip), and cross-signal isolation (log timeout storm cannot starve traces/metrics workers)2026-03-22-executor-saturation-load-test.mdImplementation plan for executor saturation load tests2026-03-22-executor-saturation-load-test-design.mdDesign spec for executor saturation load tests
- Three integration test classes exercise the resilience.py circuit breaker under sustained failure: ghost thread accumulation asserts worker pool stays bounded; circuit breaker lifecycle drives the full state machine; cross-signal isolation verifies that a log exporter saturated by timeouts cannot starve traces or metrics workers. Each test uses a 5ms timeout for reliable triggering and autouse fixtures that reset resilience state.
qualify
internal
1 file
test_executor_saturation.py
- Added docs covering the design spec and step-by-step implementation plan for the executor saturation load test suite.
specify
internal
2 files
2026-03-22-executor-saturation-load-test.md2026-03-22-executor-saturation-load-test-design.md
Resilience test hardening and memray fixes
10 files changed
test_logger_core.pyExtended tests for the updated FilteringBoundLogger behaviorconftest.pyAnchors memray test paths to project root via VERSION file lookuptest_backpressure_stress.pyFixed test path anchoringtest_bounded_growth_stress.pyFixed test path anchoringtest_logging_stress.pyFixed test path anchoringtest_metrics_stress.pyFixed test path anchoringtest_pii_stress.pyFixed test path anchoringtest_sampling_stress.pyFixed test path anchoringtest_tracing_stress.pyFixed test path anchoringtest_code_review_regressions_4b.pyUpdated regression test for new processor behavior
- Memray test conftest now resolves the project root by walking up from file to find VERSION rather than using relative paths, making tests relocatable. Memray tests excluded from mutmut stats collection to prevent false mutation-kill credit.
qualify
internal
8 files
conftest.pytest_backpressure_stress.pytest_bounded_growth_stress.pytest_logging_stress.pytest_metrics_stress.pytest_pii_stress.pytest_sampling_stress.pytest_tracing_stress.py
- Thread drain assertion in test_logger_core changed from < to <= to avoid flaky failures under parallel test runners where exact thread counts vary by timing.
qualify
internal
1 file
test_logger_core.py
TypeScript SDK examples
22 files changed
basic_logging.tsBasic logging usage examplecontext_binding.tsContext binding examplemetrics.tsMetrics API exampletracing.tsDistributed tracing examplepii_sanitization.tsPII sanitization exampleopenobserve.tsOpenObserve integration example01_emit_all_signals.tsEmit logs, metrics, and traces to OpenObserve02_verify_ingestion.tsVerify signal ingestion in OpenObserve03_hardening_profile.tsHardening profile with OpenObserve01_basic_telemetry.tsBasic telemetry setup02_w3c_propagation.tsW3C trace context propagation03_sampling_and_backpressure.tsSampling and backpressure configuration04_runtime_reconfigure.tsRuntime reconfiguration05_pii_and_cardinality_policy.tsPII and cardinality policy configuration06_exporter_resilience_modes.tsExporter resilience modes07_slo_and_health_snapshot.tsSLO and health snapshot08_full_hardening_profile.tsFull hardening profile09_error_handling_and_degradation.tsError handling and graceful degradation10_performance_metrics.tsPerformance metrics11_lazy_loading_proof.tsLazy loading proof-of-conceptpackage-lock.jsonLockfile for TypeScript examples dependencies.gitignoreIgnore stryker reports and build artifacts
- Added 20+ TypeScript example files covering the full SDK surface: basic logging, context binding, metrics, tracing, PII sanitization, OpenObserve integration (3 scenarios), and 11 progressive telemetry examples covering W3C propagation, sampling, backpressure, runtime reconfiguration, cardinality policy, exporter resilience, SLO health, hardening profiles, and lazy loading.
specify
internal
22 files
basic_logging.tscontext_binding.tsmetrics.tstracing.tspii_sanitization.tsopenobserve.ts01_emit_all_signals.ts02_verify_ingestion.ts03_hardening_profile.ts01_basic_telemetry.ts02_w3c_propagation.ts03_sampling_and_backpressure.ts04_runtime_reconfigure.ts05_pii_and_cardinality_policy.ts06_exporter_resilience_modes.ts07_slo_and_health_snapshot.ts08_full_hardening_profile.ts09_error_handling_and_degradation.ts10_performance_metrics.ts11_lazy_loading_proof.tspackage-lock.json.gitignore
Bump to v0.3.18
6 files changed
VERSIONBumped to 0.3.18pyproject.tomlVersion bump; updated codespell skip list to include typescript artifactsCONFIGURATION.mdAdded UNDEF_LOG_MODULE_LEVELS to configuration referencememray_analysis.pyMinor updatesmemray_bounded_growth_stress.pyMinor updatestracemalloc_audit.pyMinor updates