[FEAT] Add per-model token and error Prometheus metrics (part of #699)#813
Conversation
Summary of ChangesHello @ardecode, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the observability of the router by introducing model-level Prometheus metrics. It enables detailed tracking of token usage for non-streaming requests and comprehensive error reporting, categorized by model and error type. This enhancement provides crucial insights into model performance and operational issues, forming a vital part of a larger initiative to bolster monitoring capabilities. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces valuable per-model Prometheus metrics for token usage and errors, which will significantly improve observability. The implementation is well-structured. I've identified a minor bug in the token counting logic that could lead to undercounting when a token count is zero and have provided a suggestion to fix it. Overall, this is a great addition.
Add model-level Prometheus metrics to enable granular observability: - vllm:input_tokens_total counter with [server, model] labels - vllm:output_tokens_total counter with [server, model] labels - vllm:request_errors_total counter with [server, model, error_type] labels Token tracking extracts usage data from non-streaming responses. Error tracking captures exception types for debugging. Part of vllm-project#699 Signed-off-by: ardecode <desaiarijit@gmail.com>
5f0a68b to
57321a4
Compare
|
@zerofishnoodles ready for review! |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Arijit Desai <desaiarijit@gmail.com>
d21b316 to
1a7b895
Compare
|
Hi @ruizhang0101 ready for review! |
Summary
This PR adds model-level Prometheus metrics to improve observability in the router.
Metrics added
vllm:input_tokens_totalwith labels[server, model]vllm:output_tokens_totalwith labels[server, model]vllm:request_errors_totalwith labels[server, model, error_type]Implementation details
Scope relative to #699
This PR implements part of the metrics proposed in #699.
Not included (follow-ups)
Refs #699