litellm/tests/test_litellm/integrations
michelligabriele 35eb303098
fix(prometheus): sanitize label values to prevent metric scrape failures (#20600)
* fix(prometheus): sanitize label values to prevent metric scrape failures

Unicode characters like U+2028 (Line Separator) in Prometheus label values
break the text exposition format, causing scrapers (e.g. Datadog) to fail
parsing the entire /metrics endpoint. One bad label value causes ALL metrics
to be lost, not just the affected metric.

Add _sanitize_prometheus_label_value() and apply it in prometheus_label_factory()
and all direct .labels() call sites.

* fix(prometheus): handle non-string label values in sanitization

Coerce non-string values (int, bool, float) to str before applying
sanitization, preventing AttributeError on .replace() calls.

* fix(prometheus): run sanitization on coerced non-string values

Non-string values should be coerced to str and then sanitized (not
returned early), so their string representations also get cleaned.

* fix(prometheus): widen type hint to Optional[Any] for label value sanitization
2026-02-09 15:48:59 -08:00
..
arize fixing arize tests 2026-01-23 23:13:21 -08:00
azure_storage Fixing circular reference for azure storage 2026-01-14 16:11:55 -08:00
bitbucket (Feat) Add BitBucket Integration for Prompt Management (#14882) 2025-09-25 15:51:00 -07:00
cloudzero fix: test 2026-01-09 11:23:47 +09:00
datadog feat: add datadog cost management support and fix startup callback issue (#19584) 2026-01-22 19:52:14 -08:00
dotprompt test_dotprompt_with_prompt_version 2025-11-22 11:00:47 -08:00
focus fix: test 2026-01-09 11:23:47 +09:00
gcs_bucket update GCSBucketBase to handle GSM project ID if passed (#11409) 2025-06-04 10:02:26 -07:00
gcs_pubsub Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
gitlab TestEncryptResponseId 2026-01-07 21:03:22 +05:30
langfuse Revert "feat: Add built-in migration lock to prevent concurrent Prisma migrat…" (#18719) 2026-01-06 23:56:02 +05:30
levo TestLevoIntegration 2026-01-07 18:17:22 +05:30
open_telemetry/data add metrics and logs (events) with semconv attributes 2025-09-02 09:20:25 -06:00
SlackAlerting Litellm sameer oct staging (#15806) 2025-10-24 12:17:22 -07:00
websearch_interception Add tests for WebSearch interception with chat completions API 2026-02-09 13:41:29 +05:30
test_agentops.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_anthropic_cache_control_hook.py [Fix] Anthropic cache_control incorrectly applied to all content items instead of last item only (#15699) 2025-10-18 15:18:08 -07:00
test_athina.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_azure_sentinel.py [Feat] New Logging Integration - Azure Sentinel Logger (#18146) 2025-12-18 02:04:49 +05:30
test_braintrust_logging.py [Bug]: Fix tests to reference moved attributes in braintrust_logging module (#13978) 2025-08-26 18:58:16 -07:00
test_braintrust_span_name.py Add details in docs (#15721) 2025-10-21 16:57:51 -07:00
test_custom_guardrail.py fix: anthropic during call guardrail error 2026-01-14 13:37:01 +09:00
test_custom_guardrail_recursion.py fix: recursive pydantic issue (#19531) 2026-01-22 19:56:41 -08:00
test_custom_prompt_management.py [Fix] CI/CD - Fix failing proxy and core integration tests (#17926) 2025-12-13 10:11:01 -08:00
test_deepeval.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_langfuse.py Fix test isolation for test_log_langfuse_v2_handles_null_usage_values (#20475) 2026-02-05 12:57:41 -08:00
test_langfuse_otel.py Litellm fix langfuse otel trace (#20382) 2026-02-03 22:40:19 -08:00
test_langsmith_init.py fix(langsmith.py): add langsmith_sampling_rate as a dynamic param 2025-09-17 17:32:26 -07:00
test_mlflow.py Fix: MLflow streaming spans for Anthropic passthrough (#17288) 2025-12-05 14:59:36 -08:00
test_openmeter.py [Bug]: Set user from token user_id for OpenMeter integration 2025-07-30 22:23:30 +02:00
test_opentelemetry.py fix(otel): update semantic conventions to 1.38 (gen_ai attributes) (#18793) 2026-01-09 23:43:44 +05:30
test_opentelemetry_dynamic_imports.py Make grpc dependency optional (#19447) 2026-01-20 19:03:52 -08:00
test_prometheus_cache_metrics.py feat(prometheus): add caching metrics (#18755) 2026-01-07 21:29:04 +05:30
test_prometheus_client_ip_user_agent.py feat: add clientip and user agent in metrics (#19717) 2026-01-25 23:07:19 -08:00
test_prometheus_invalid_key_filtering.py refactor(prometheus): skip metrics for invalid API key requests (#18788) 2026-01-07 17:14:14 -08:00
test_prometheus_labels.py fix(prometheus): sanitize label values to prevent metric scrape failures (#20600) 2026-02-09 15:48:59 -08:00
test_prometheus_metric_name_consistency.py fix: align prometheus metric names with DEFINED_PROMETHEUS_METRICS (#18463) 2026-01-04 00:48:09 +05:30
test_prometheus_missing_metrics.py add callbacks and labels to prometheus (#19708) 2026-01-25 23:03:23 -08:00
test_prometheus_queue_guardrail_metrics.py feat: Add Prometheus metrics for request queue time and guardrails (#17973) 2026-01-06 23:50:11 +05:30
test_prometheus_services.py fix(proxy): resolve high CPU when router_settings in DB by avoiding REGISTRY.collect() in PrometheusServicesLogger (#20087) 2026-01-30 14:01:45 -08:00
test_prometheus_user_team_metrics.py Metrics prometheus user team count (#19520) 2026-01-22 08:17:15 -08:00
test_responses_background_cost.py Revert "Stabilise mock tests" 2026-01-17 06:26:18 +09:00
test_s3_v2.py Add allowing Key based prefix to s3 path (#16237) 2025-11-05 14:43:21 -08:00
test_weave_otel.py feat: Basic Weave OTEL integration (#17439) 2025-12-03 21:26:22 -08:00