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

Better usability for mongodb_collstats_storageStats_indexSizes_.* metrics #882

Closed
rpstw opened this issue Jul 26, 2024 · 2 comments · Fixed by #953
Closed

Better usability for mongodb_collstats_storageStats_indexSizes_.* metrics #882

rpstw opened this issue Jul 26, 2024 · 2 comments · Fixed by #953

Comments

@rpstw
Copy link
Contributor

rpstw commented Jul 26, 2024

#97 introduce index sizes metrics years ago, which is useful for huge indexes monitoring.

However, similar to no.3 in #97 (comment), for every index, there will be a separate metric for every single index. For example, mongodb_collstats_storageStats_indexSizes_user_id_1 and mongodb_collstats_storageStats_indexSizes_id_1 could be the same metric (index size) for a same collection.

The number of indexes, or to be more precisely, the number of series is not a major concern from our side.

The problem is it's not of good usability. Here's the argue:

To query the index sizes, we have to perform a regex __name__ query, like {__name__=~"mongodb_collstats_storageStats_indexSizes_.*"}. This works but IMO is against the normal usage pattern of prometheus. A quote from their best practice:

should represent the same logical thing-being-measured across all label dimensions.

Therefor I propose we change the metric format from mongodb_collstats_storageStats_indexSizes_keya_1_keyb_1 to mongodb_collstats_storageStats_indexSizes{name="keya_1_keyb_1"}.The name of index will be a label instead of being included in the metric name.Since it's a backward break change, there should be a flag control this incompatible change. I'm ok with it being default old format.

Any thoughts?

@BupycHuk
Copy link
Member

Hello, sounds like a good suggestion, let us discuss with Percona experts and ask if they really need per index metric and if they don't we will rework it to provide some agregated metrics

@rnovikovP
Copy link
Contributor

Related Jira issue": https://perconadev.atlassian.net/browse/PMM-9870

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants