urguru opened a new pull request, #1097: URL: https://github.com/apache/yunikorn-core/pull/1097
### Description Dynamic queue removal (YUNIKORN-2908) resets terminal state gauges (completed/failed/rejected) to zero on queue recreation. This adds a CounterVec (`yunikorn_queue_app_total`) for terminal states that persists across queue lifecycle by reusing the existing Prometheus registration. See https://issues.apache.org/jira/browse/YUNIKORN-3310 for full context. ### Type of change - [x] Bug Fix ### Jira issue Jira ID : https://issues.apache.org/jira/browse/YUNIKORN-3310 - [x] I have created a Jira issue for this pull request. - [x] The Jira ID is part of the title of this pull request. ### AI Tooling - [x] The PR includes the phrase "Generated by Claude Code", where Claude Code is the name of the AI tool used. - [x] My use of AI contributions follows the ASF legal policy. Claude Code was used for making the code changes and validations. Generated by Claude Code ### How has this been tested? - [x] New unit tests were added to cover new or changed code paths. - [ ] `make test_all` was run, and no failures reported. - [ ] A pull request will be opened for new e2e tests (apache/yunikorn-k8shim repository). Testing performed: * `go build ./...` passes * `go test ./pkg/metrics/...` passes (including new `TestApplicationsTerminalTotal`) * `go test ./pkg/scheduler/objects/...` passes * `go test ./pkg/scheduler/objects/ -race` passes * Deployed to a test cluster and verified the counter persists across dynamic queue removal and recreation ### Questions: - [ ] The change needs documentation, a pull request for apache/yunikorn-site repository will be created. - [ ] There is breaking changes for older versions: jira is tagged with `release-notes` label. - [ ] The licenses files needs to be updated. ### Screenshots or other details **Files changed:** - `pkg/metrics/queue.go` — Add `appTerminalMetrics` CounterVec, register with reuse logic, exclude from `UnregisterMetrics()`, add 3 `Inc*Total()` methods - `pkg/scheduler/objects/application_state.go` — Increment terminal counters in FSM callbacks for Completed, Failed, and Rejected states - `pkg/metrics/queue_test.go` — Add `TestApplicationsTerminalTotal`, update `unregisterQueueMetrics()` helper -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
