Skip to content
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

Expose cardinality of labels as metrics #15505

Open
Amoolaa opened this issue Dec 20, 2024 · 1 comment
Open

Expose cardinality of labels as metrics #15505

Amoolaa opened this issue Dec 20, 2024 · 1 comment

Comments

@Amoolaa
Copy link

Amoolaa commented Dec 20, 2024

Is your feature request related to a problem? Please describe.
In our multi-tenanted setup, we frequently have teams using high cardinality loki labels and not following labelling best practices.

Describe the solution you'd like
While this output is exposed in logcli via something like logcli series '{}' --since=1h --analyze-labels, my proposal is to expose this data under a metrics endpoint.

It allows:

  • Users to quickly view this data in a dashboard and adjust their labelling practices
  • A historic view on cardinality counts
  • Alerting on high cardinality counts, for either us (the platform team) or the users

I think giving some sort of out-of-the-box functionality (vs getting users to logcli their way to view this data) will be beneficial to users and platforms teams for monitoring usage.

Describe alternatives you've considered
Writing our own service that calls the logcli endpoint, parses the output and exposes as metrics. This isn't hard to do, but if there's an opportunity to contribute to the upstream project for others, why not?

Even just giving an option to expose the output of the --analyze-labels as json would be better, for parsing reasons

@mveitas
Copy link
Contributor

mveitas commented Dec 20, 2024

100% agree with this and in support of exposing this information

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

No branches or pull requests

2 participants