File tree Expand file tree Collapse file tree 5 files changed +29
-0
lines changed
Expand file tree Collapse file tree 5 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ Add a renamed metric that was missed from the [1.75 release of LiteLLM](https://github.com/BerriAI/litellm/pull/13271)
Original file line number Diff line number Diff line change 7878 'litellm_team_budget_remaining_hours_metric' : "team.budget.remaining_hours.metric" ,
7979 'litellm_team_max_budget_metric' : "team.max_budget.metric" ,
8080 'litellm_total_tokens' : "total.tokens" ,
81+ 'litellm_total_tokens_metric' : "total.tokens" ,
8182 'process_start_time_seconds' : {"name" : "process.uptime.seconds" , "type" : "time_elapsed" },
8283 # Deprecated
8384 'litellm_llm_api_failed_requests_metric' : "llm.api.failed_requests.metric" ,
Original file line number Diff line number Diff line change @@ -119,3 +119,9 @@ def get_fixture_path(filename):
119119 'litellm.endpoint.healthy_count' ,
120120 'litellm.endpoint.unhealthy_count' ,
121121]
122+
123+ RENAMED_METRICS_V1_75 = [
124+ 'litellm.total.tokens.count' ,
125+ 'litellm.input_tokens.metric.count' ,
126+ 'litellm.output_tokens.metric.count' ,
127+ ]
Original file line number Diff line number Diff line change 1+ # HELP litellm_total_tokens_metric_total Total number of input + output tokens from LLM requests
2+ # TYPE litellm_total_tokens_metric_total counter
3+ litellm_total_tokens_metric_total 0.0
4+ # HELP litellm_input_tokens_metric_total Total number of input tokens from LLM requests
5+ # TYPE litellm_input_tokens_metric_total counter
6+ litellm_input_tokens_metric_total 0.0
7+ # HELP litellm_output_tokens_metric_total Total number of output tokens from LLM requests
8+ # TYPE litellm_output_tokens_metric_total counter
9+ litellm_output_tokens_metric_total 0.0
Original file line number Diff line number Diff line change 1212 ENDPOINT_METRICS ,
1313 METRICS ,
1414 OM_MOCKED_INSTANCE ,
15+ RENAMED_METRICS_V1_75 ,
1516 get_fixture_path ,
1617)
1718
@@ -89,3 +90,14 @@ def test__extract_error_type_not_found():
8990 check = LitellmCheck ('litellm' , {}, [{}])
9091 error_msg = 'no litellm error here'
9192 assert check ._extract_error_type (error_msg ) == 'unknown'
93+
94+
95+ def test_litellm_renamed_metrics (dd_run_check , aggregator , mock_http_response ):
96+ # Some metrics were renamed here: https://github.com/BerriAI/litellm/pull/13271
97+ mock_http_response (file_path = get_fixture_path ('renamed_metrics.txt' ))
98+ check = LitellmCheck ('litellm' , {}, [OM_MOCKED_INSTANCE ])
99+ dd_run_check (check )
100+ for metric in RENAMED_METRICS_V1_75 :
101+ aggregator .assert_metric (metric )
102+ aggregator .assert_all_metrics_covered ()
103+ aggregator .assert_service_check ('litellm.openmetrics.health' , ServiceCheck .OK )
You can’t perform that action at this time.
0 commit comments