proxy: add excludeFromMetrics option to hide models from activity stats#678
proxy: add excludeFromMetrics option to hide models from activity stats#678mytbk wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR introduces a metrics exclusion feature by adding an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/configuration.md`:
- Around line 403-410: The docs entry for the "qwen-hidden-metrics" model only
mentions hiding requests from /ui/#/activity but the implementation also filters
the metrics API; update the prose for the excludeFromMetrics field under the
"qwen-hidden-metrics" block to state that when excludeFromMetrics: true the
model will be excluded from both the SSE activity stream (/ui/#/activity) and
the metrics API (GET /api/metrics), so users understand it affects both
surfaces.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 989627d9-913b-4cd0-b1b9-e682a2040016
📒 Files selected for processing (3)
docs/configuration.mdproxy/config/model_config.goproxy/proxymanager_api.go
| # Exclude model from metrics example: | ||
| "qwen-hidden-metrics": | ||
| # excludeFromMetrics: boolean, true or false | ||
| # - optional, default: false | ||
| # - when true, requests to this model will not appear in /ui/#/activity | ||
| # - useful for hiding test or internal models from usage statistics | ||
| excludeFromMetrics: true | ||
| cmd: llama-server --port ${PORT} -m Qwen3-4B-Q4_K_M.gguf -ngl 0 |
There was a problem hiding this comment.
Mention that this also affects the metrics API.
The implementation filters both SSE activity and GET /api/metrics, but Line 407 only documents /ui/#/activity. Add the API endpoint so users understand the full behavior.
Suggested docs tweak
- # - when true, requests to this model will not appear in /ui/#/activity
+ # - when true, requests to this model will not appear in /ui/#/activity or /api/metrics📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Exclude model from metrics example: | |
| "qwen-hidden-metrics": | |
| # excludeFromMetrics: boolean, true or false | |
| # - optional, default: false | |
| # - when true, requests to this model will not appear in /ui/#/activity | |
| # - useful for hiding test or internal models from usage statistics | |
| excludeFromMetrics: true | |
| cmd: llama-server --port ${PORT} -m Qwen3-4B-Q4_K_M.gguf -ngl 0 | |
| # Exclude model from metrics example: | |
| "qwen-hidden-metrics": | |
| # excludeFromMetrics: boolean, true or false | |
| # - optional, default: false | |
| # - when true, requests to this model will not appear in /ui/#/activity or /api/metrics | |
| # - useful for hiding test or internal models from usage statistics | |
| excludeFromMetrics: true | |
| cmd: llama-server --port ${PORT} -m Qwen3-4B-Q4_K_M.gguf -ngl 0 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/configuration.md` around lines 403 - 410, The docs entry for the
"qwen-hidden-metrics" model only mentions hiding requests from /ui/#/activity
but the implementation also filters the metrics API; update the prose for the
excludeFromMetrics field under the "qwen-hidden-metrics" block to state that
when excludeFromMetrics: true the model will be excluded from both the SSE
activity stream (/ui/#/activity) and the metrics API (GET /api/metrics), so
users understand it affects both surfaces.
Add excludeFromMetrics field to ModelConfig that allows excluding a model's requests from appearing in the /ui/#/activity page and metrics API. - adds excludeFromMetrics boolean config option (default: false) - filters excluded models in apiGetMetrics endpoint - filters excluded models in SSE events - adds documentation in configuration.md --- Co-authored-by: opencode (minimax-m2.5-free)
e7daaa0 to
4b91f85
Compare
Add excludeFromMetrics field to ModelConfig that allows excluding a model's requests from appearing in the /ui/#/activity page and metrics API.
Co-authored-by: opencode (minimax-m2.5-free)