litellm/tests
Luis Gallego Ledesma 52372dcbe9 fix(langfuse_otel): prevent empty proxy request spans from being sent to Langfuse
When using langfuse_otel callback, empty traces were being sent to Langfuse
for requests that didn't result in actual LLM calls (e.g., auth operations,
health checks, failed requests). These traces contained only internal proxy
operations (auth, postgres, proxy_pre_call) with no useful LLM data.

Root cause: LangfuseOtelLogger extends OpenTelemetry, which sets itself as
the proxy's open_telemetry_logger. This caused create_litellm_proxy_request_started_span
to be called for every request, creating a parent span that was sent to Langfuse
even when no LLM call occurred.

Fix: Override create_litellm_proxy_request_started_span in LangfuseOtelLogger
to return None, preventing the creation of empty parent spans. This is consistent
with the existing overrides for async_service_success_hook and async_service_failure_hook
which already prevent service-level logs from being sent to Langfuse.

Fixes: Empty traces in Langfuse v3 when using langfuse_otel callback
2026-01-28 15:35:35 +01:00
..
agent_tests
audio_tests
basic_proxy_startup_tests
batches_tests chore: remove unused test files from repository root (#19150) 2026-01-16 02:34:41 +05:30
code_coverage_tests Add test for Router.get_valid_args, fix router code coverage encoding (#19797) 2026-01-26 10:14:58 -08:00
documentation_tests fix: test_env_keys 2026-01-20 18:37:56 +05:30
enterprise Merge pull request #19636 from BerriAI/litellm_langfuse_callback 2026-01-28 18:02:17 +05:30
guardrails_tests Merge branch 'main' into litellm_staging_01_19_2026 2026-01-20 19:19:36 +05:30
image_gen_tests Fix: imagegeneration@006 has been deprecated 2026-01-22 18:24:59 +05:30
litellm Merge pull request #19661 from Chesars/fix/oci-image-url-format 2026-01-28 15:26:50 +05:30
litellm_core_utils fix(bedrock): deduplicate tool calls in assistant history (#15178) (#19324) 2026-01-19 10:56:49 -08:00
litellm_utils_tests feat: hashicorp vault rotate support 2026-01-23 17:32:55 +09:00
litellm-proxy-extras fix: resolve 'does not exist' migration errors as applied in setup_database (#19281) 2026-01-26 22:11:36 -08:00
llm_responses_api_testing Fix: Responses API logging error for StopIteration 2026-01-23 18:42:33 +05:30
llm_translation Merge pull request #19910 from BerriAI/main 2026-01-28 08:30:47 +05:30
load_tests
local_testing Fix: timeout exception raised eror 2026-01-27 12:32:37 +05:30
logging_callback_tests fix: add openinference span kinds to arize phoenix 2026-01-23 16:32:49 -05:00
mcp_tests Merge branch 'main' into litellm_oss_staging_01_26_2026 2026-01-27 17:00:58 +05:30
multi_instance_e2e_tests
ocr_tests
old_proxy_tests/tests
openai_endpoints_tests
otel_tests
pass_through_tests
pass_through_unit_tests TestBedrockInvokeToolSearch 2026-01-24 15:36:30 -08:00
proxy_admin_ui_tests Make test_get_users_key_count deterministic by creating dedicated test user (#19795) 2026-01-26 10:13:15 -08:00
proxy_security_tests
proxy_unit_tests Add tests for native_background_mode feature 2026-01-27 16:48:22 -08:00
router_unit_tests Add test for Router.get_valid_args, fix router code coverage encoding (#19797) 2026-01-26 10:14:58 -08:00
scim_tests
search_tests skip brave tests 2026-01-22 10:50:23 -08:00
spend_tracking_tests increasing time for spend tracking 2026-01-20 16:31:25 -08:00
store_model_in_db_tests
test_litellm Merge pull request #19914 from BerriAI/litellm_responses_api_bridge_usage 2026-01-28 18:35:30 +05:30
unified_google_tests Revert "[Infra] Changing Google Tests to use Gemini 3 Flash Preview" 2026-01-20 17:32:10 -08:00
vector_store_tests [Feat] RAG API - Add s3_vectors as provider on /vector_store/search API + UI for creating + PDF support for /rag/ingest (#19895) 2026-01-27 16:30:59 -08:00
windows_tests
__init__.py
gettysburg.wav
large_text.py
openai_batch_completions.jsonl
README.MD
test_budget_management.py
test_callbacks_on_proxy.py
test_config.py
test_debug_warning.py
test_default_encoding_non_root.py fix: resolve Read-only file system error in non-root images (#19449) 2026-01-20 19:00:52 -08:00
test_end_users.py
test_entrypoint.py
test_fallbacks.py
test_gpt5_azure_temperature_support.py
test_health.py
test_keys.py Adding retries to flaky tests 2026-01-22 15:21:44 -08:00
test_litellm_proxy_responses_config.py
test_logging.conf
test_models.py
test_openai_endpoints.py
test_organizations.py Adding retries to flaky tests 2026-01-22 15:21:44 -08:00
test_passthrough_endpoints.py
test_proxy_server_non_root.py deactivating non root tests 2026-01-23 22:55:36 -08:00
test_ratelimit.py
test_resource_cleanup.py
test_service_logger_otel.py fix(langfuse_otel): prevent empty proxy request spans from being sent to Langfuse 2026-01-28 15:35:35 +01:00
test_spend_logs.py
test_team_logging.py
test_team_members.py
test_team.py test_team_update_sc_2 2026-01-24 13:17:32 -08:00
test_users.py

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.