Skip to content

Conversation

@Venkat2811
Copy link
Contributor

Pull Request Description

This change adds:

  • vtc_bucket_size_active custom metric gauge to see if any config change is needed in vtc-basic
  • centralized metrics utility for custom metrics like the above in this project

Related Issues

#1011 (comment)

Submission Checklist

  • PR title includes appropriate prefix(es)
  • Changes are clearly explained in the PR description
  • New and existing tests pass successfully
  • Code adheres to project style and best practices
  • Documentation updated to reflect changes (if applicable)
  • Thorough testing completed, no regressions introduced

@Jeffwan Jeffwan requested review from Jeffwan and Copilot May 9, 2025 04:38
@Jeffwan
Copy link
Collaborator

Jeffwan commented May 9, 2025

I will take a look at it tomorrow

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new custom metric gauge, vtc_bucket_size_active, along with centralized metrics utilities to support its use in the vtc-basic algorithm and its tests. Key changes include:

  • Adding gauge metric update in the BasicVTCRouter.Route method.
  • Extending test coverage with TestVTCBucketSizePatterns and related helper functions.
  • Integrating the new metric into the metrics package and updating module dependencies.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/plugins/gateway/algorithms/vtc/vtc_basic_test.go Added tests for vtc_bucket_size_active metric behavior and patterns
pkg/plugins/gateway/algorithms/vtc/vtc_basic.go Updated routing logic to record the new metric using adaptiveBucketSize
pkg/metrics/metrics.go Introduced the constant and configuration for vtc_bucket_size_active
pkg/metrics/custom_metrics_test.go Added tests for custom metric registration and update behavior
pkg/metrics/custom_metrics.go Updated helper functions for gauge and counter metric handling
go.mod Added dependency for godebug
Comments suppressed due to low confidence (2)

pkg/plugins/gateway/algorithms/vtc/vtc_basic_test.go:617

  • Consider adding assertions to verify that the detected pattern matches expected outcomes instead of solely logging results for improved test validation.
if pattern.detectFunc(sizes) {

pkg/metrics/custom_metrics.go:94

  • The GetGaugeValueForTest function always returns 0; consider implementing it to actually return the current gauge value to improve the reliability of tests referencing it.
return 0

Copy link
Collaborator

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me!

@Venkat2811 Venkat2811 force-pushed the gw-plugin-vtc-metric branch from 0a999a7 to 2469e97 Compare May 11, 2025 19:11
@Jeffwan Jeffwan merged commit afd92e7 into vllm-project:main May 11, 2025
13 checks passed
Yaegaki1Erika pushed a commit to Yaegaki1Erika/aibrix that referenced this pull request Jul 23, 2025
…roject#1065)

* feat: metrics initial gauge impl with tests pass
* feat: use custrom_metrics under /metrics
* feat: lint
* feat: address review comments

---------

Signed-off-by: Venkat Raman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants