Skip to content

Conversation

rneuter
Copy link

@rneuter rneuter commented Jun 5, 2025

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 cluster label to all metrics collected by the SLM collector. This is achieved by injecting the clusterinfo.Retriever into 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.Retriever dependency to the factortyFunc, 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.

@rneuter rneuter force-pushed the feature/slmCollectorClusterAware branch from a1e44c3 to b84263b Compare June 5, 2025 12:44
rneuter added 3 commits June 5, 2025 18:40
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 rneuter force-pushed the feature/slmCollectorClusterAware branch from 9d4cea3 to aa2752c Compare June 5, 2025 16:41
@rneuter rneuter changed the title Feature/slm collector cluster aware Add cluster label to SLM metrics Jun 6, 2025
@rneuter rneuter marked this pull request as ready for review June 6, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant