serving icon indicating copy to clipboard operation
serving copied to clipboard

[wip] Make autoscaler instrument async so we can remove metric attributes when revisions go away

Open dprotaso opened this issue 1 week ago • 2 comments

Fixes https://github.com/knative/serving/issues/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

dprotaso avatar Dec 11 '25 01:12 dprotaso

Codecov Report

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

Files with missing lines Patch % Lines
pkg/autoscaler/scaling/metrics.go 94.02% 4 Missing :warning:
pkg/autoscaler/scaling/autoscaler.go 80.00% 2 Missing :warning:
pkg/reconciler/autoscaling/kpa/metrics.go 93.33% 1 Missing and 1 partial :warning:
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              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Dec 11 '25 01:12 codecov[bot]

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

/assign @Cali0707 @linkvt

dprotaso avatar Dec 11 '25 18:12 dprotaso

[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

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

knative-prow[bot] avatar Dec 11 '25 19:12 knative-prow[bot]

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

dprotaso avatar Dec 11 '25 19:12 dprotaso

@dprotaso: new pull request created: #16301

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.

knative-prow-robot avatar Dec 11 '25 19:12 knative-prow-robot

@dprotaso: new pull request created: #16302

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.

knative-prow-robot avatar Dec 11 '25 19:12 knative-prow-robot