GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make autoscaler instrument async so we can remove metric attributes when revisions go away by dprotaso · Pull Request #16300 · knative/serving

Conversation

@dprotaso

@dprotaso dprotaso commented Dec 11, 2025

Copy link
Copy Markdown
Member

Fixes #16200

Proposed Changes

  • This switches instruments to async allow us to remove them when revisions go away

Release Note

Switch to async metric instrumentation to avoid unbounded memory growth

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dprotaso added 2 commits December 10, 2025 14:11
@dprotaso
switch autoscaler metrics to be async - allowing removal
1028423
@dprotaso
allow removing kpa metrics when a revision goes away
41c9473
@knative-prow knative-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 11, 2025
@knative-prow
knative-prow Bot requested review from dsimansk and skonto December 11, 2025 01:40
@knative-prow knative-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 11, 2025
@codecov

codecov Bot commented Dec 11, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.07407% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.06%. Comparing base (5fbd94e) to head (41c9473).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/autoscaler/scaling/metrics.go 94.02% 4 Missing ⚠️
pkg/autoscaler/scaling/autoscaler.go 80.00% 2 Missing ⚠️
pkg/reconciler/autoscaling/kpa/metrics.go 93.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16300      +/-   ##
==========================================
- Coverage   80.10%   80.06%   -0.04%     
==========================================
  Files         215      215              
  Lines       13332    13361      +29     
==========================================
+ Hits        10679    10697      +18     
- Misses       2294     2305      +11     
  Partials      359      359              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dprotaso dprotaso changed the title [wip] Make autoscaler instrument async so we can remove metric attributes when revisions go away Make autoscaler instrument async so we can remove metric attributes when revisions go away Dec 11, 2025
@knative-prow knative-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 11, 2025
@dprotaso

dprotaso commented Dec 11, 2025

Copy link
Copy Markdown
Member Author

Ok tested this locally and confirmed the metrics go away when the revisions are deleted

/assign @Cali0707 @linkvt

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot assigned Cali0707 and linkvt Dec 11, 2025
Cali0707
Cali0707 approved these changes Dec 11, 2025
View reviewed changes

@Cali0707 Cali0707 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

/lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Dec 11, 2025
@knative-prow

knative-prow Bot commented Dec 11, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, dprotaso

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [dprotaso]

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow
knative-prow Bot merged commit 6d9d1b6 into knative:main Dec 11, 2025
@dprotaso
dprotaso deleted the otel-remove branch December 11, 2025 19:23
@dprotaso

dprotaso commented Dec 11, 2025

Copy link
Copy Markdown
Member Author

/cherry-pick release-1.19
/cherry-pick release-1.20

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow-robot

knative-prow-robot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

@dprotaso: new pull request created: #16301

Details

In response to this:

/cherry-pick release-1.19
/cherry-pick release-1.20

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow-robot knative-prow-robot mentioned this pull request Dec 11, 2025
[release-1.19] Make autoscaler instrument async so we can remove metric attributes when revisions go away #16301
Merged
@knative-prow-robot

knative-prow-robot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

@dprotaso: new pull request created: #16302

Details

In response to this:

/cherry-pick release-1.19
/cherry-pick release-1.20

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow-robot knative-prow-robot mentioned this pull request Dec 11, 2025
[release-1.20] Make autoscaler instrument async so we can remove metric attributes when revisions go away #16302
Merged
norman465 pushed a commit to src2img/knative-serving that referenced this pull request Dec 15, 2025
@dprotaso @norman465
Make autoscaler instrument async so we can remove metric attributes w…
33c41b7
…hen revisions go away (knative#16300)

* switch autoscaler metrics to be async - allowing removal

* allow removing kpa metrics when a revision goes away
@dprotaso dprotaso mentioned this pull request Jan 22, 2026
Metrics (kn_revision_pods_count) retains last known value after Ksvc/Revision deletion #16353
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dsimansk dsimansk Awaiting requested review from dsimansk
@skonto skonto Awaiting requested review from skonto
1 more reviewer
@Cali0707 Cali0707 Cali0707 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@linkvt linkvt

@Cali0707 Cali0707

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Autoscaler is reporting stale metrics for services/revisions

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@dprotaso @knative-prow-robot @Cali0707 @linkvt
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.