abhishekrb19 opened a new pull request, #18876: URL: https://github.com/apache/druid/pull/18876
This patch adds task dimensions to the `ServiceEmitter` so individual monitors no longer need to pass the task holder to retrieve task dimensions and append them on every monitor call. Some of the monitors were even missing these task dimensions. The added dimensions include `taskId`, `dataSource`, `taskType` and `groupId`. This change ensures that all task metrics are emitted with these task dimensions by default and in a consistent format. Changes: - Plumb `TaskHolder` into the `ServiceEmitter` via the `EmitterModule`. - Add a new method, TaskHolder.getMetricDimensions(), and override it as appropriate. - Initialize the dimensions once during the ServiceEmitter’s `start()` by calling `TaskHolder.getMetricDimensions()`. This is done during the `start()` explicitly to ensure all the dependencies are ready. - Move the `TaskHolder` and `NoopTaskHolder` classes from the `server` module to the `processing` module for better reuse. - Remove and cleanup all usages of the `dimension` map from the individual monitor implementation since this is taken care of already. - Add `TestLoadSpecHolder`; this isn’t really in scope for this change, so I’m happy to move it out to simplify review if needed. - The remainder of the changes are primarily tests and related refactoring. #### Release note All task metrics are emitted with the following dimensions: `taskId`, `dataSource`, `taskType`, `groupId`, and `id` (for backward compatibility; `id` will be removed in favor of the `taskId` dimension in a future release). This PR has: - [x] been self-reviewed. - [x] a release note entry in the PR description. - [x] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. - [x] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [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. - [x] been tested in a test Druid cluster. -- 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]
