litellm/tests/test_litellm/integrations
devin-ai-integration[bot] 989d7b87b2
fix(proxy): attribute provider and model_info on pre_call_hook rejections (#41077)
* fix(proxy): attribute provider and model info on pre-call rejected requests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): keep pre-call rejections out of deployment cooldown and prometheus deployment state

Stamp model_info only into the logging metadata so the router's failure callbacks do not
count a key-level 429 or guardrail 403 against the deployment, treat a resolved plus an
unresolved deployment as ambiguous provider attribution, and stop the prometheus deployment
counters and deployment_state from treating a proxy-side reject as a selected deployment

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): skip deployment attribution when the rejected body's model is not a string

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(prometheus): bucket non-string request models as other instead of raising in failure hook

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): resolve team deployments and treat guardrail rejects as proxy-side in failure attribution

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(prometheus): flag pre-routing rejects instead of matching exception names

Post-call GuardrailRaisedException failures kept their deployment labels on main but lost them
on this branch because every GuardrailRaisedException was treated as a pre-routing reject.
The proxy failure path now flags litellm_params with proxy_rejected_before_routing only when
it adds deployment attribution itself, and the Prometheus logger keys deployment selection
off that flag

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): key pre-routing reject flag off provider handoff, not caller metadata

Caller-supplied metadata.model_info (kept for keys allowed to override pricing) no longer
suppresses proxy_rejected_before_routing. The hook now checks the logging object's
first_api_call_start_time, which only the provider handoff sets, so Prometheus never
records a deployment failure for a request that was rejected before routing.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(e2e): poll for both served and rejected spend rows before asserting attribution

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: yucheng <yucheng@berri.ai>
2026-09-22 14:14:13 -07:00
..
arize feat(arize): per-team success and error sampling rates for the Arize AX callback (#42383) 2026-09-22 11:21:40 -05:00
azure_storage
bitbucket
cloudzero fix(cloudzero): preserve late resource tags (#39873) 2026-09-05 12:10:05 -07:00
code_interpreter_interception
datadog fix(types): blank non-string datadog tool text fields, look the spend table up by name 2026-09-21 14:10:09 -07:00
dotprompt
focus fix(spend-tracking): hand plain dict rows to polars in the CloudZero and Focus exports 2026-09-03 18:46:01 -07:00
gitlab
langfuse
levo test: migrate wave 1 phase 2 legacy unit tests to tests/unit 2026-09-20 07:50:43 +00:00
newrelic
open_telemetry test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
otel fix(otel): honor SSL_CERT_FILE and ssl_verify in OTLP HTTP exporters (#42106) 2026-09-22 20:50:53 +00:00
SlackAlerting test(alerting): inject the webhook client and extend the mapped test files 2026-09-21 14:16:37 -07:00
websearch_interception fix(websearch_interception): keep intercepted searches under the parent request's session and trace (#41711) 2026-09-22 12:35:27 -07:00
conftest.py fix(otel): honor SSL_CERT_FILE and ssl_verify in OTLP HTTP exporters (#42106) 2026-09-22 20:50:53 +00:00
rubrik_test_helpers.py
test_agentops.py
test_anthropic_cache_control_hook.py fix: reserve cap slots for direct marks on /v1/messages when extra_body unmarks them 2026-09-21 11:39:25 -07:00
test_athina.py
test_azure_sentinel.py
test_braintrust_logging.py
test_braintrust_span_name.py
test_custom_guardrail.py Revert "Merge pull request #41220 from BerriAI/litellm_post_call_guardrail_context" 2026-09-19 17:45:15 +00:00
test_custom_guardrail_recursion.py
test_custom_prompt_management.py
test_deepeval.py
test_galileo.py
test_guardrail_logging_sync.py
test_helicone.py
test_langfuse.py refactor(langfuse): remove unreachable langfuse v1 logging path 2026-09-17 20:04:50 +00:00
test_langfuse_otel.py
test_langsmith_init.py fix(langsmith): json.dumps with default=str so non-serializable metadata does not crash batch flush (#42424) 2026-09-22 12:21:11 -07:00
test_lunary.py
test_mlflow.py
test_openmeter.py test: unwind environment writes in tests/test_litellm with monkeypatch (#37806) 2026-08-21 20:28:37 -07:00
test_opentelemetry.py fix(otel): honor SSL_CERT_FILE and ssl_verify in OTLP HTTP exporters (#42106) 2026-09-22 20:50:53 +00:00
test_opentelemetry_dynamic_imports.py
test_opik_utils.py
test_otel_guardrail_violation_spans.py
test_otel_team_attributes_matrix.py
test_prometheus_api_promql_escape.py
test_prometheus_budget_metric_guard.py
test_prometheus_budget_metrics_db_lookups.py
test_prometheus_budget_metrics_timeout.py
test_prometheus_cache_metrics.py
test_prometheus_caller_identity.py
test_prometheus_carried_budget_state.py
test_prometheus_client_ip_user_agent.py
test_prometheus_custom_metadata_label_counts.py
test_prometheus_deployment_state_proxy_rejects.py fix(proxy): attribute provider and model_info on pre_call_hook rejections (#41077) 2026-09-22 14:14:13 -07:00
test_prometheus_end_user_cardinality.py test(prometheus): cover customer budget series expiry by end_user ttl 2026-09-16 19:22:30 +00:00
test_prometheus_input_sequence_length_label.py
test_prometheus_invalid_key_filtering.py fix(prometheus): count 401 auth failures in litellm_proxy_failed_requests_metric 2026-09-15 02:09:00 +00:00
test_prometheus_labels.py fix(prometheus): label pre-call rate limit failures with the resolved api_provider 2026-09-14 19:50:21 +00:00
test_prometheus_mcp_tool_metrics.py
test_prometheus_media_generation_metrics.py
test_prometheus_metric_name_consistency.py test(prometheus): restore the full registry and build admission metrics fresh in the dashboard fixture 2026-09-17 09:21:19 +00:00
test_prometheus_metrics_endpoint.py
test_prometheus_missing_metrics.py
test_prometheus_none_metadata.py
test_prometheus_overhead_with_guardrails.py
test_prometheus_queue_guardrail_metrics.py
test_prometheus_rate_limit_labels.py
test_prometheus_remaining_tokens_router_fallback.py
test_prometheus_requested_model_cardinality.py fix(proxy): attribute provider and model_info on pre_call_hook rejections (#41077) 2026-09-22 14:14:13 -07:00
test_prometheus_service_tier_label.py
test_prometheus_services.py
test_prometheus_spend_logs_metadata.py
test_prometheus_stream_label.py
test_prometheus_token_detail_metrics.py
test_prometheus_user_team_metrics.py fix(prometheus): skip customer budget cache read when end_user tracking is off 2026-09-16 20:23:59 +00:00
test_prometheus_zero_cost_metric.py feat(cost): warn and count $0 cost on billable requests (#42345) 2026-09-21 19:49:26 -07:00
test_prompt_manager_ssti.py
test_responses_background_cost.py
test_rubrik.py
test_s3.py test(s3): type the prompts-only test helpers 2026-09-15 23:40:35 +00:00
test_s3_v2.py test(s3): type the prompts-only test helpers 2026-09-15 23:40:35 +00:00
test_shadow_eval_logger.py
test_weave_otel.py