Coverage for src/lumen/observability/__init__.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.16.0, created at 2026-08-31 18:46 +0000

1"""OpenTelemetry (OTLP) observability for Lumen (Phase 13b). 

2 

3All OpenTelemetry imports live inside this package so the rest of the codebase 

4stays library-agnostic. Everything is gated behind ``ObservabilitySettings.enabled``; 

5with telemetry disabled the setup functions are no-ops and the domain-metric 

6helpers record into no-op instruments, so the server behaves exactly as before. 

7""" 

8 

9from .metrics import ( 

10 record_hook_duration, 

11 record_hook_failure, 

12 record_interaction, 

13 record_search_duration, 

14 record_validation_error, 

15) 

16from .otel import instrument_fastapi, setup_telemetry 

17 

18__all__ = [ 

19 "instrument_fastapi", 

20 "record_hook_duration", 

21 "record_hook_failure", 

22 "record_interaction", 

23 "record_search_duration", 

24 "record_validation_error", 

25 "setup_telemetry", 

26]