LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
UN-2830 [MISC] Suppress OpenTelemetry EventLogger deprecation warning in prompt-service (#1585)
Chandrasekharan M8eb50f7128ae
diff --git a/prompt-service/src/unstract/prompt_service/config.py b/prompt-service/src/unstract/prompt_service/config.pyindex 4b892ac8e..7d72d92ff 100644--- a/prompt-service/src/unstract/prompt_service/config.py+++ b/prompt-service/src/unstract/prompt_service/config.py@@ -1,4 +1,5 @@import logging+import warningsfrom os import environ as envfrom dotenv import load_dotenv@@ -22,6 +23,19 @@ def create_app() -> Flask:"""Creates and configures the Flask application."""log_level = env.get("LOG_LEVEL", LogLevel.INFO.value).upper()setup_logging(log_level)++ # Suppress OpenTelemetry EventLogger LogRecord deprecation warning+ # This is a bug in OpenTelemetry SDK 1.37.0 where EventLogger.emit() still uses+ # deprecated trace_id/span_id/trace_flags parameters instead of context parameter.+ # See: https://github.com/open-telemetry/opentelemetry-python/issues/4328+ # TODO: Remove this suppression once OpenTelemetry fixes EventLogger.emit()+ warnings.filterwarnings(+ "ignore",+ message="LogRecord init with.*trace_id.*span_id.*trace_flags.*deprecated",+ category=DeprecationWarning,+ module="opentelemetry.sdk._events",+ )+log_level = getattr(logging, log_level, logging.INFO)app = Flask("prompt-service")app.logger.setLevel(log_level)