fix(vllm metrics): error stack trace #3200
Open
+118
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes: https://issues.redhat.com/browse/RHOAIENG-11522
this is a situation that would result in the error stack and ui crash without this change:
Description
prevent ui from crashing. let the query be undefined if it doesn't exist, which will result in an empty data and no errors. vince said he did not want an error message at all as it might convey to the user that it might resolve with a refresh or something.
How Has This Been Tested?
tested code on a previous deploy that would crash the ui on metrics page, it no longer crashes. used MR cluster to test. existing tests still pass.
Test Impact
added a new test using mock data that only contains 1 query and made sure that the 4 charts show up (instead of an error stack page). i also updated the test mock for
prometheus/serving
to return empty results if the request body includesquery=undefined\b
as it would in the real endpoint. Here's a screenshot from a test with a missing query resulting in no data for one of the serving endpoints (it still shows the data):Request review criteria:
test a vllm deploy, view the metrics. also view metrics of other types.
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main