INNER CODE UNIT · Python

create_app

speaches-ai/speaches · src/speaches/main.py:97

def create_app() -> FastAPI:
    config = get_config()  # HACK
    setup_logger(config.log_level)
    logger = logging.getLogger(__name__)

    logger.debug(f"Config: {config}")

    # Initialize OpenTelemetry if endpoint is configured
    if config.otel_exporter_otlp_endpoint:
        from speaches.tracing import setup_telemetry

        setup_telemetry(config.otel_exporter_otlp_endpoint, config.otel_service_name)

        # Auto-instrument common libraries
        from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
        from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor
        from opentelemetry.instrumentation.logging import LoggingInstrumentor

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…