server.web.otlp =============== .. py:module:: server.web.otlp .. autoapi-nested-parse:: Server-specific OpenTelemetry instrumentation for jobmon. This package contains server-specific OTLP functionality that should not be in the shared jobmon_core package. It handles: - FastAPI application instrumentation - SQLAlchemy engine instrumentation - Server-specific configuration patterns - Structured logging with structlog Architecture: - Delegates to JobmonOTLPManager from core for shared functionality - Adds server-specific instrumentation methods - Provides server-specific structured logging handlers Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/server/web/otlp/manager/index Attributes ---------- .. autoapisummary:: server.web.otlp.OTLP_AVAILABLE Classes ------- .. autoapisummary:: server.web.otlp.ServerOTLPManager Functions --------- .. autoapisummary:: server.web.otlp.get_server_otlp_manager server.web.otlp.initialize_server_otlp Package Contents ---------------- .. py:data:: OTLP_AVAILABLE :value: True .. py:class:: ServerOTLPManager Server-specific OTLP manager that builds on core functionality. .. py:attribute:: _core_manager :type: Optional[Any] :value: None .. py:attribute:: _initialized :value: False .. py:attribute:: _fastapi_instrumented :value: False .. py:attribute:: _requests_instrumented :value: False .. py:attribute:: _sqlalchemy_instrumented :value: False .. py:method:: initialize() -> None Initialize the core OTLP manager for server use. .. py:property:: tracer_provider :type: Optional[Any] Get the tracer provider from core manager. .. py:property:: logger_provider :type: Optional[Any] Get the logger provider from core manager. .. py:method:: get_tracer(name: str) -> Optional[Any] Get a tracer for the given name. .. py:method:: instrument_app(app: Any) -> None Instrument FastAPI application with OpenTelemetry. This is server-specific functionality that should not be in core. .. py:method:: instrument_requests() -> None :classmethod: Instrument requests library - server-specific implementation. .. py:method:: instrument_sqlalchemy() -> None :classmethod: Instrument SQLAlchemy globally - server-specific implementation. .. py:method:: instrument_engine(engine: Any) -> None :classmethod: Instrument a specific SQLAlchemy engine - server-specific implementation. .. py:function:: get_server_otlp_manager() -> ServerOTLPManager Get or create the server OTLP manager singleton. .. py:function:: initialize_server_otlp() -> ServerOTLPManager Initialize server-specific OTLP functionality. This should be called by the server during startup. :returns: The server OTLP manager instance