amaechler opened a new pull request, #20735:
URL: https://github.com/apache/druid/pull/20735
### Description
`task/running/count` and `task/pending/count` dropped all dimensions for
tasks the task runner still reports after the Overlord is done with them, such
as a killed task that is still shutting down on its worker. `TaskQueue` only
looked these tasks up among non-complete `activeTasks` entries and used an
empty key otherwise, so they showed up as `unknown` in Prometheus.
These tasks now keep their `dataSource`, `taskType` and `supervisorId`. The
key comes from the task's `activeTasks` entry, even if it is complete, or else
from the task held by the runner's work item, through a new `@Nullable
TaskRunnerWorkItem.getTask()`. It defaults to `null`, so existing extensions
keep working, and the five in-tree work items override it. Keeping
`supervisorId` also stops these rows from overwriting the supervisor's row in
StatsD, whose default config keys this gauge by `dataSource` and `taskType`
only.
Side note: both counts now share one method that looks each runner task up
in `activeTasks` directly, which removes `getCurrentTaskDatasources()` and its
per-call map of every active task's key.
Follow-up to #20726.
#### Release note
`task/running/count` and `task/pending/count` now keep their `dataSource`,
`taskType` and `supervisorId` dimensions for tasks that are still shutting
down, instead of reporting them without dimensions.
<hr>
##### Key changed/added classes in this PR
* `TaskQueue`
* `TaskRunnerWorkItem`
<hr>
This PR has:
- [x] been self-reviewed.
- [x] a release note entry in the PR description.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]