Harmonize metrics for lag and cost based autoscalers.#19097
Merged
gianm merged 4 commits intoapache:masterfrom Mar 6, 2026
Merged
Harmonize metrics for lag and cost based autoscalers.#19097gianm merged 4 commits intoapache:masterfrom
gianm merged 4 commits intoapache:masterfrom
Conversation
This patch adjusts the autoscalers to emit metrics with supervisorId, dataSource, and stream. Previously, the lag-based autoscaler emitted only dataSource (which was actually the supervisor id) and stream, and the cost-based autoscaler emitted only supervisorId and stream.
...java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java
Fixed
Show fixed
Hide fixed
...org/apache/druid/indexing/seekablestream/supervisor/autoscaler/LagBasedAutoScalerConfig.java
Fixed
Show fixed
Hide fixed
jtuglu1
approved these changes
Mar 6, 2026
| ); | ||
| log.info( | ||
| "LagBasedAutoScaler will collect lag every [%d] millis and will keep up to [%d] data points for the last [%d] millis for dataSource [%s]", | ||
| "LagBasedAutoScaler will collect lag every [%d] millis and will keep up to [%d] data points for the last [%d] millis for supervisor [%s]", |
|
|
||
| log.debug("Calculated beyondProportion is [%s] and withinProportion is [%s] for dataSource [%s].", beyondProportion, | ||
| withinProportion, dataSource | ||
| log.debug("Calculated beyondProportion is [%s] and withinProportion is [%s] for supervisor [%s].", beyondProportion, |
| log.debug("CurrentActiveTaskCount reached task count Max limit, skipping scale out action for dataSource [%s].", | ||
| dataSource | ||
| log.debug( | ||
| "CurrentActiveTaskCount reached task count Max limit, skipping scale out action for supervisor [%s].", |
| log.debug("CurrentActiveTaskCount reached task count Min limit, skipping scale in action for dataSource[%s].", | ||
| dataSource | ||
| log.debug( | ||
| "CurrentActiveTaskCount reached task count Min limit, skipping scale in action for supervisor[%s].", |
Contributor
There was a problem hiding this comment.
maybe log the min limit here since might be different from current spec's config
kfaraz
approved these changes
Mar 6, 2026
Comment on lines
+193
to
+196
| CollectionUtils.getOnlyElement( | ||
| spec.getDataSources(), | ||
| xs -> DruidException.defensive("Expected one dataSource, got[%s]", xs) | ||
| ), |
Contributor
There was a problem hiding this comment.
I think we can skip passing the dataSource here and just extract it from the spec inside the LagBasedAutoScaler.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This patch adjusts the autoscalers to emit metrics with supervisorId, dataSource, and stream. Previously, the lag-based autoscaler emitted only dataSource (which was actually the supervisor id) and stream, and the cost-based autoscaler emitted only supervisorId and stream.