diff --git a/litellm/integrations/opentelemetry.py b/litellm/integrations/opentelemetry.py index 76b8ec75c5..1572eb81f5 100644 --- a/litellm/integrations/opentelemetry.py +++ b/litellm/integrations/opentelemetry.py @@ -884,15 +884,20 @@ class OpenTelemetry(CustomLogger): return BatchSpanProcessor(ConsoleSpanExporter()) @staticmethod - def _get_headers_dictionary(headers: Optional[Union[str, dict]]) -> dict: + def _get_headers_dictionary(headers: Optional[Union[str, dict]]) -> Dict[str, str]: """ Convert a string or dictionary of headers into a dictionary of headers. """ - _split_otel_headers = {} + _split_otel_headers: Dict[str, str] = {} if headers: if isinstance(headers, str): - _split_otel_headers = headers.split("=") - _split_otel_headers = {_split_otel_headers[0]: _split_otel_headers[1]} + # when passed HEADERS="x-honeycomb-team=B85YgLm96******" + # Split only on first '=' occurrence + parts = headers.split("=", 1) + if len(parts) == 2: + _split_otel_headers = {parts[0]: parts[1]} + else: + _split_otel_headers = {} elif isinstance(headers, dict): _split_otel_headers = headers return _split_otel_headers diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 851fa996c9..0b9722eb41 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -2663,9 +2663,9 @@ def _init_custom_logger_compatible_class( # noqa: PLR0915 and callback.callback_name == "arize" ): return callback # type: ignore - _otel_logger = ArizeLogger(config=otel_config, callback_name="arize") - _in_memory_loggers.append(_otel_logger) - return _otel_logger # type: ignore + _arize_otel_logger = ArizeLogger(config=otel_config, callback_name="arize") + _in_memory_loggers.append(_arize_otel_logger) + return _arize_otel_logger # type: ignore elif logging_integration == "arize_phoenix": from litellm.integrations.opentelemetry import ( OpenTelemetry,