Skip to content

Add cluster label to SLM metrics #1046

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant