Add cluster label to SLM metrics - #1046
Open
rneuter wants to merge 3 commits into
Open
Conversation
rneuter
force-pushed
the
feature/slmCollectorClusterAware
branch
from
June 5, 2025 12:44
a1e44c3 to
b84263b
Compare
Signed-off-by: Rémy Neuter <remy.neuter@gmail.com>
Signed-off-by: Rémy Neuter <remy.neuter@gmail.com>
Signed-off-by: Rémy Neuter <remy.neuter@gmail.com>
rneuter
force-pushed
the
feature/slmCollectorClusterAware
branch
from
June 5, 2025 16:41
9d4cea3 to
aa2752c
Compare
rneuter
marked this pull request as ready for review
June 6, 2025 08:13
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 pull request introduces a new feature to the SLM collector, making it cluster-aware (#889)
Previously, the metrics exposed by the SLM collector did not include any cluster-specific labels. This made it difficult to distinguish SLM statistics in multi-cluster environments, as it was not possible to filter them by cluster name.
These changes address this limitation by adding a
clusterlabel to all metrics collected by the SLM collector. This is achieved by injecting theclusterinfo.Retrieverinto the collector, which then provides the necessary cluster information.On a more technical approach:
1st, I'm not an heavy go programmer, tried to do my best 😄 .
My main thoughts are on the 1st work that I had to do, injecting
clusterInfo.Retrieverdependency to thefactortyFunc, so each collector can register itself as a cluster info retriever consumer, if needed.I saw that another technical approach was used with the shards & indices collectors, but they are not implementing the collector interface so I thought my approach was "ok". Also, it means that shards & indices collectors can probably be migrated more easily now that collector implementations can get clusterInfo (?).
Please let me know if you think on some improvements.