-
Notifications
You must be signed in to change notification settings - Fork 25.8k
allocation: add duration and count metrics for write load hotspot #138465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
schase-es
merged 14 commits into
elastic:main
from
schase-es:ES-13381_write-load-monitor-hotspot-metrics
Dec 5, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c37f19b
allocation: add duration and count metrics for write load hotspot
schase-es 75119f5
Update docs/changelog/138465.yaml
schase-es 0e86fd5
Reverting tests
schase-es aca449c
Enable metrics sending when master, added separate tests
schase-es 1c31b0e
Changed metrics turn-off facility to turn off when new data stops coming
schase-es 913acb8
Merge branch 'main' into ES-13381_write-load-monitor-hotspot-metrics
schase-es d1462fc
Clear out hotspot duration table when the cluster state term changes
schase-es 2e0e4c2
[CI] Auto commit changes from spotless
e415267
Moving static constants
schase-es 0cebca4
Changing out count/updated duo for single field
schase-es e4e1422
Move of start times recording into method
schase-es 586ae69
Moving duration recording into separate method
schase-es 600dd97
Merge branch 'main' into ES-13381_write-load-monitor-hotspot-metrics
schase-es 58dd7d1
Make master and local node the same for write constraint monitor tests
schase-es File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 138465 | ||
| summary: "Allocation: add duration and count metrics for write load hotspot" | ||
| area: Allocation | ||
| type: enhancement | ||
| issues: [] |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to return an empty list here if we're not the master, otherwise we'll get a bunch of bogus values each metric interval from the non-master nodes.
Perhaps
getHotSpotNodesCountcould switch it to-1and then we could only report if it's been switched back to an actual value (theInternalClusterInfoServicestops refreshing the cluster info when the node is no longer master so this approach would naturally only report metrics from the master).Or any other approach you think is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to make this a cluster state listener, we will stop receiving new
ClusterInfowhen we are no longer master.If we make this listen to the cluster state, it adds more dependencies and will add a tiny additional cost to the cluster state applier thread (negligible but we should try and do that as little as possible).
I think I prefer my suggestion to only return a hot-spot node count if we've calculated one since last time we were polled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would also be presumably simpler to test (just confirm we only return the count if
onNewInfohas been called since last time we asked)