Skip to content

Conversation

@googs1025
Copy link
Member

@googs1025 googs1025 commented Dec 2, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

Introduce SchedulerAttemptsTotal counter with "success"/"failure" status
labels. This improves observability of
the scheduler for monitoring, alerting, and debugging in production.

Which issue(s) this PR fixes:

Fixes None

Does this PR introduce a user-facing change?:

Added `scheduler_attempts_total` counter metric with `status` label to improve scheduler observability.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 2, 2025
@netlify
Copy link

netlify bot commented Dec 2, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 1f791b7
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/6934339af1cde10007127b63
😎 Deploy Preview https://deploy-preview-1931--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: googs1025
Once this PR has been reviewed and has the lgtm label, please assign ahg-g for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 2, 2025
// RecordSchedulingOutcome records metrics at the end of a scheduling attempt,
// including latency, attempt status.
func RecordSchedulingOutcome(duration time.Duration, err error) {
RecordSchedulerE2ELatency(duration)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this metric should be nested in here. Please remove this call.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed


defer func() {
metrics.RecordSchedulerE2ELatency(time.Since(scheduleStart))
metrics.RecordSchedulingOutcome(time.Since(scheduleStart), err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please replace this line and the deleted line above with:

Suggested change
metrics.RecordSchedulingOutcome(time.Since(scheduleStart), err)
duration := time.Since(scheduleStart)
metrics.RecordSchedulerE2ELatency(duration)
metrics.RecordSchedulingOutcome(duration, err)

@googs1025 googs1025 force-pushed the metrics/scheduler_counter branch 2 times, most recently from f54475a to 6983812 Compare December 4, 2025 01:12
@googs1025 googs1025 changed the title feat(metrics): add scheduler attempt counter and outcome helper feat(metrics): add scheduler attempt counter Dec 4, 2025
Signed-off-by: CYJiang <googs1025@gmail.com>
@googs1025 googs1025 force-pushed the metrics/scheduler_counter branch from 6983812 to 1f791b7 Compare December 6, 2025 13:46
@googs1025 googs1025 requested a review from shmuelk December 6, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants