litellm/tests/unit/proxy/management_endpoints
yucheng-berri 757041adc2
feat(otel): add Mixpanel OpenTelemetry v2 preset callback (#49999)
* feat(otel): add Mixpanel OpenTelemetry v2 preset callback

* fix(otel): address CI type/format checks, credential registry, and 100% coverage

* test(proxy): cover Mixpanel destination-setting-only callback validation branch

* fix(otel): give Mixpanel the caller's user.id on every span

The preset takes over from #48638. Spans after auth now carry the id the
caller named, in the proxy's project and in a team's or key's own project,
and a request's id never reaches another backend. `metadata["user.id"]`
only labels spans, so customer limits and spend logs stay as they are on
main. Mixpanel tokens that could never work get a 400 on every writer, and
a request with no project token keeps the operator's region.

* fix(otel): name one caller on every Mixpanel span and refuse padded masked tokens

The id read at auth now replaces a user.id already on the span in Mixpanel's copy, so a value a
mapper wrote for another backend no longer splits a request across two callers. A padded masked or
"None" project token is refused like the bare value.

* fix(ui): give the Mixpanel callback an i18n description key

Main moved callback descriptions to locale keys, so the Mixpanel entry's
inline description no longer type checks.

* test: type the Mixpanel tests and give their import suppressions a reason

* fix(otel): accept a blank Mixpanel region and refuse a var-less key entry without OTel v2

A missing, blank or null mixpanel_region already exports to the US
endpoint, so saving one no longer returns 400, and the endpoint no longer
warns about it. A key logging entry naming mixpanel with no callback_vars
now gets the same OTel v2 refusal as one with vars.

* test: wrap two long Mixpanel test lines

* test(otel): leave the pre-body cached key read out of the Mixpanel id check

Main now reads a cached key before the request body to refuse a blocked
key. That span ends before auth names the caller, like the auth span's
own children, so it carries no id.

* Merge the two callback_config_validation imports in team_endpoints

* Refuse an unsendable Mixpanel entry sent as a JSON-string metadata.logging on team writes

* Annotate new test variables with Final

---------

Co-authored-by: Nausherwan Korai <230245508+naushkorai@users.noreply.github.com>
2026-11-25 10:27:02 -08:00
..
management_v1 feat(proxy): add app groups with shared budgets and usage (#53232) 2026-11-21 12:50:58 -08:00
policy_endpoints fix(policy): drop refused temperatures on policy template enrichment calls (#53311) 2026-11-21 14:01:06 -08:00
scim test(scim): key the roster repair test's cached user with AuthObject.user (#54200) 2026-11-24 17:48:57 +00:00
search_endpoints refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
sso ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
usage_endpoints
__init__.py
jwt_key_mapping_doubles.py feat(auth): read virtual keys, jwt key mappings and model access groups through rust repositories (#52173) 2026-11-18 03:53:37 +00:00
test_access_group_endpoints.py fix(proxy): preserve concurrent access group assignments (#53840) 2026-11-23 16:27:41 -08:00
test_access_group_management.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_activity_tenant_scoping.py
test_auto_router_endpoints.py feat(auth): read teams, team memberships and organizations through rust repositories (#52176) 2026-11-18 22:32:05 +00:00
test_budget_endpoints.py feat(proxy)!: carry unused budget into the next period with a cap (#53309) 2026-11-22 02:05:03 -08:00
test_cache_settings_endpoints.py
test_callback_management_endpoints.py feat(otel): add Mixpanel OpenTelemetry v2 preset callback (#49999) 2026-11-25 10:27:02 -08:00
test_common_daily_activity.py feat(customer-portal): show token usage and cache costs (#52601) 2026-11-18 18:49:08 -08:00
test_common_utils.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_compliance_endpoints.py
test_config_override_endpoints.py
test_coordination_redis_endpoints.py
test_cost_estimate_endpoint.py refactor(router): move router callers onto the entry points and invert the proxy imports (#48847) 2026-10-29 17:26:33 +00:00
test_cost_tracking_settings.py fix(router): register a model_id Bedrock deployment after an ARN deployment for the same profile (#53461) 2026-11-22 22:27:56 +00:00
test_credential_migration.py fix(proxy): rotate all database secrets with the master key (#52998) 2026-11-20 10:02:59 -08:00
test_customer_budget.py fix(proxy): /customer/new budgets reset on the same schedule as other budgets (#51689) 2026-11-13 19:22:14 +00:00
test_customer_endpoints.py refactor(auth_cache_invalidation): move the invalidation channel to the native client (#51135) 2026-11-21 18:58:27 +09:00
test_daily_activity_routes.py feat(skills): export download history as streamed CSV (#52569) 2026-11-21 21:14:46 +00:00
test_delete_callbacks_endpoint.py
test_delete_verification_tokens_failed.py feat(auth): read virtual keys, jwt key mappings and model access groups through rust repositories (#52173) 2026-11-18 03:53:37 +00:00
test_encryption_endpoints.py
test_entraid_app_roles.py
test_gateway_request_endpoints.py refactor(proxy): inject gateway activity through a typed repository (#49116) 2026-10-30 16:25:11 -07:00
test_id_jag_assertion_capture.py
test_internal_user_endpoints.py feat(caching): configure semantic cache params per key, user and team (#53905) 2026-11-23 13:55:45 -08:00
test_jwt_key_mapping.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_key_budget_change.py feat(auth): read teams, team memberships and organizations through rust repositories (#52176) 2026-11-18 22:32:05 +00:00
test_key_generate_prisma.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_key_management_endpoints.py feat(proxy): give AI API service accounts safe default routes only (#54027) 2026-11-24 11:43:32 -05:00
test_management_route_coverage.py
test_mcp_connector_import.py
test_mcp_management_endpoints.py feat(mcp): persist per-server event settings (#53602) 2026-11-24 06:31:10 +00:00
test_mcp_servers.py
test_model_deprecation_alerts.py feat(proxy): add model deprecation alerts with daily requests by key (#50022) 2026-11-05 04:03:42 +00:00
test_model_insights_endpoints.py feat(alerts): detect daily changes in recorded usage (#50666) 2026-11-11 18:23:02 -08:00
test_model_management_endpoints.py fix(openrouter): report the context window and output cap from OpenRouter's catalog (#54046) 2026-11-24 04:37:30 -08:00
test_org_admin_team_access.py
test_organization_endpoints.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_password_endpoints.py feat(proxy): hash UI passwords with PBKDF2 in FIPS mode (#49874) 2026-11-06 01:31:59 -08:00
test_policy_endpoints.py fix(guardrails): log requests that a guardrail blocks on /apply_guardrail (#51014) 2026-11-16 15:18:08 -08:00
test_project_org_authz.py
test_prompt_cache_prediction.py feat(callbacks-parallel-request-limiter): port parallel request limiter v3 to a rust callback (#51537) 2026-11-16 22:56:38 -08:00
test_prompt_caching_requests.py fix(proxy): cancel the Admin UI's raw spend-log reads in Postgres after 30s (#49965) 2026-11-03 16:07:00 -08:00
test_ptu_consumption.py
test_ptu_model_settings.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_request_error_endpoints.py
test_roi_calculator_endpoints.py
test_router_settings_endpoints.py
test_saml_sso.py
test_session_endpoints.py
test_sso_helper_utils.py refactor(rust_bridge): route every Rust-to-Python call through host modules (#50822) 2026-11-11 01:57:54 +00:00
test_subscription_accounts.py feat(auth): decide key and JWT authentication in a Rust core (#51374) 2026-11-17 14:07:47 +09:00
test_tag_management_endpoints.py feat(proxy)!: carry unused budget into the next period with a cap (#53309) 2026-11-22 02:05:03 -08:00
test_team_admin_field_permissions.py feat(lens): add key and team tracing controls (#53191) 2026-11-23 17:59:37 +00:00
test_team_callback_endpoints.py
test_team_default_params.py feat(team): let default_team_params attach access_group_ids to every new team (#49908) 2026-11-05 19:58:51 -08:00
test_team_endpoints.py fix(proxy): preserve concurrent access group assignments (#53840) 2026-11-23 16:27:41 -08:00
test_team_model_alias_merge.py
test_tool_management_endpoints.py
test_ui_sso.py fix(proxy): accept special-use email domains in generic SSO (#54026) 2026-11-24 19:16:23 -05:00
test_user_agent_analytics_endpoints.py refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
test_workflow_management_endpoints.py feat(control_plane): dataplane registry, credential strategies and client (#49655) 2026-11-16 17:36:23 +00:00