Add new metrics for litellm - #24955
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 51ada47 | Docs | View more details | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55bdd12d4e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
evalya-impact-summaryevalya impact analysis |
jeff-morgan-dd
left a comment
There was a problem hiding this comment.
Please add metric descriptions where noted - thank you!
| litellm.proxy.pre_call.latency.sum,count,,millisecond,,Latency for proxy_pre_call service,0,litellm,,, | ||
| litellm.proxy.pre_call.total_requests.count,count,,request,,Number of requests for proxy_pre_call service in the time period,0,litellm,,, | ||
| litellm.proxy.total_requests.metric.count,count,,request,,Number of requests made to the proxy server in the time period - track number of client side requests,0,litellm,,, | ||
| litellm.redis.daily_agent_spend_update_queue.size,gauge,,,,litellm_redis_daily_agent_spend_update_queue_size,0,litellm,,, |
There was a problem hiding this comment.
Can you please update to include a brief description of what the metric does? Currently the description just repeats the metric name.
| litellm.proxy.pre_call.total_requests.count,count,,request,,Number of requests for proxy_pre_call service in the time period,0,litellm,,, | ||
| litellm.proxy.total_requests.metric.count,count,,request,,Number of requests made to the proxy server in the time period - track number of client side requests,0,litellm,,, | ||
| litellm.redis.daily_agent_spend_update_queue.size,gauge,,,,litellm_redis_daily_agent_spend_update_queue_size,0,litellm,,, | ||
| litellm.redis.daily_end_user_spend_update_queue.size,gauge,,,,litellm_redis_daily_end_user_spend_update_queue_size,0,litellm,,, |
There was a problem hiding this comment.
Can you please update to include a brief description of what the metric does? Currently the description just repeats the metric name.
There was a problem hiding this comment.
Sorry forgot to push the uncommitted changes. Thanks for catching!
Validation ReportAll 21 validations passed. Show details
|
jeff-morgan-dd
left a comment
There was a problem hiding this comment.
Thanks for the updates!
| @@ -0,0 +1 @@ | |||
| Add new metrics for litellm | |||
There was a problem hiding this comment.
Is this adding support for metrics added in 1.9.5+? If so I'd make a note that we now support 1.9.5 in the changelog
|
|
||
| for metric in NEW_METRICS_V1_95: | ||
| aggregator.assert_metric(metric) | ||
|
|
There was a problem hiding this comment.
Do we have a test that calls assert_metrics_using_metadata? And could we add one if we don't?
| aggregator.assert_service_check('litellm.openmetrics.health', ServiceCheck.OK) | ||
|
|
||
|
|
||
| def test_litellm_v1_95_new_metrics_are_mapped(dd_run_check, aggregator, mock_http_response): |
There was a problem hiding this comment.
what does this test verify that test_litellm_v1_95_metrics doesn't?
| litellm_request_queue_time_seconds_count{api_key_alias="None",api_provider="openai",end_user="None",hashed_api_key="litellm_proxy_master_key",model="gpt-4o-cache-read",model_id="00b3700001b042d4a2e4db444b6e5b1a70197fdb0224960e846f23f576b76439",org_alias="None",org_id="None",requested_model="mock-cache-read",team="None",team_alias="None",user="default_user_id"} 3.0 | ||
| litellm_request_queue_time_seconds_sum{api_key_alias="None",api_provider="openai",end_user="None",hashed_api_key="litellm_proxy_master_key",model="gpt-4o-cache-read",model_id="00b3700001b042d4a2e4db444b6e5b1a70197fdb0224960e846f23f576b76439",org_alias="None",org_id="None",requested_model="mock-cache-read",team="None",team_alias="None",user="default_user_id"} 0.0004284381866455078 | ||
| litellm_request_queue_time_seconds_bucket{api_key_alias="None",api_provider="openai",end_user="None",hashed_api_key="litellm_proxy_master_key",le="0.005",model="gpt-4o-cache-write",model_id="b9656ec990e75de2a6df4a65bb191f7ee8afb5cd2432c1f1c880ad4ed3d2b3ce",org_alias="None",org_id="None",requested_model="mock-cache-write",team="None",team_alias="None",user="default_user_id"} 3.0 | ||
| litellm_request_queue_time_seconds_bucket{api_key_alias="None",api_provider="openai",end_user="None",hashed_api_key="litellm_proxy_master_key",le="0.01",model="gpt-4o-cache-write",model_id="b9656ec990e75de2a6df4a65bb191f7ee8afb5cd2432c1f1c880ad4ed3d2b3ce",org_alias="None",org_id="None",requested_model="mock-cache-write",team="None",team_alias="None",user="default_user_i |
There was a problem hiding this comment.
nit- some metrics in the payload don't have example data, is it possible to generate samples or even fake ones?
What does this PR do?
Add new metrics for litellm tested with version 1.9.5