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
explain potential cardinality statistics inaccuracy #3528
Comments
Hi @vijexa ! I have checked your requests on the And i got next results "seriesCountByMetricName":[{"name":"flag","value":1278}]
|
Hello @dmitryk-dk,
|
Hi @vijexa ! Sorry for the late delay I missed that you use the cluster version. Do you use a replication factor flag? About our play - this value can be a little different because tsdb checks all index when /api/v1/series/ make merges when return result |
The /api/v1/series works in the following way in VictoriaMetrics cluster:
The /api/v1/status/tsdb works in the following way at VictoriaMetrics cluster:
Additionally, sometimes |
Yes, we use VM in cluster configuration. Configuration of the cluster that I've been using as an example is:
So what you are saying is that |
We're facing this problem as well. I can understand why it might not be fixed - making TSDB stats mergeable across a cluster of vmstorage nodes sounds like a big job! Can I suggest adding clear messaging to the documentation explaining that the numbers cannot be relied on in cluster mode. We spent a bit of time believing that we could use this API as a part of our cardinality monitoring / cardinality defense solution, time that could have been saved if this limitation were in the docs. At least two places it deserves a mention: The fact that it breaks cardinality explorer for all cluster users may provide some motivation for thinking of a solution here! |
Absolutely agreed - the docs about cardinality explorer should mention that some stats can be inaccurate for VictoriaMetrics cluster, with the explanation of this fact. I also think that the source code responsible for calculating the stats for VictoriaMetrics cluster must contain a comment with the same explanation, so developers could figure out and understand the issue more quickly. |
The info about potential inaccuracy should be added to VMUI cardinality page as well |
The info about possible inaccuracy was added to docs in PR #4678 |
Describe the bug
Hello, and thank you for this great project.
I was trying to make use of cardinality stats from
/prometheus/api/v1/status/tsdb
, but returned series count inseriesCountByMetricName
doesn't seem to be accurate. Series count is multiple times higher than what is expected and calculated by manually counting series from/prometheus/api/v1/series
.To Reproduce
Check metric series count in tsdb stats:
Retrieve metadata for all series of the same metric for the same day, then count unique series:
Expected behavior
Series count is expected to be the same in both cases, however it is very different.
Version
v1.81.2-cluster
, vmselect binary output with --version flag:vmselect-20220908-111729-tags-v1.81.2-cluster-0-ge9a0b803a
The text was updated successfully, but these errors were encountered: