From 8e3349328ff4074a3312abb1f9553380639fc470 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 13 Apr 2026 10:28:13 +0200 Subject: [PATCH] ref(litellm): Remove dead attributes --- sentry_sdk/integrations/litellm.py | 10 ------ tests/integrations/litellm/test_litellm.py | 36 ---------------------- 2 files changed, 46 deletions(-) diff --git a/sentry_sdk/integrations/litellm.py b/sentry_sdk/integrations/litellm.py index 28bcc34d3e..d6600b6600 100644 --- a/sentry_sdk/integrations/litellm.py +++ b/sentry_sdk/integrations/litellm.py @@ -159,16 +159,6 @@ def _input_callback(kwargs: "Dict[str, Any]") -> None: if value is not None: set_data_normalized(span, attribute, value) - # Record LiteLLM-specific parameters - litellm_params = { - "api_base": kwargs.get("api_base"), - "api_version": kwargs.get("api_version"), - "custom_llm_provider": kwargs.get("custom_llm_provider"), - } - for key, value in litellm_params.items(): - if value is not None: - set_data_normalized(span, f"gen_ai.litellm.{key}", value) - def _success_callback( kwargs: "Dict[str, Any]", diff --git a/tests/integrations/litellm/test_litellm.py b/tests/integrations/litellm/test_litellm.py index 9022093fa3..4af557afce 100644 --- a/tests/integrations/litellm/test_litellm.py +++ b/tests/integrations/litellm/test_litellm.py @@ -532,42 +532,6 @@ def test_additional_parameters(sentry_init, capture_events): assert span["data"][SPANDATA.GEN_AI_REQUEST_PRESENCE_PENALTY] == 0.5 -def test_litellm_specific_parameters(sentry_init, capture_events): - """Test that LiteLLM-specific parameters are captured.""" - sentry_init( - integrations=[LiteLLMIntegration()], - traces_sample_rate=1.0, - ) - events = capture_events() - - messages = [{"role": "user", "content": "Hello!"}] - mock_response = MockCompletionResponse() - - with start_transaction(name="litellm test"): - kwargs = { - "model": "gpt-3.5-turbo", - "messages": messages, - "api_base": "https://custom-api.example.com", - "api_version": "2023-01-01", - "custom_llm_provider": "custom_provider", - } - - _input_callback(kwargs) - _success_callback( - kwargs, - mock_response, - datetime.now(), - datetime.now(), - ) - - (event,) = events - (span,) = event["spans"] - - assert span["data"]["gen_ai.litellm.api_base"] == "https://custom-api.example.com" - assert span["data"]["gen_ai.litellm.api_version"] == "2023-01-01" - assert span["data"]["gen_ai.litellm.custom_llm_provider"] == "custom_provider" - - def test_no_integration(sentry_init, capture_events): """Test that when integration is not enabled, callbacks don't break.""" sentry_init(