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

VM returns different result than Prometheus #577

Closed
phantasia15 opened this issue Jun 21, 2020 · 5 comments
Closed

VM returns different result than Prometheus #577

phantasia15 opened this issue Jun 21, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@phantasia15
Copy link

phantasia15 commented Jun 21, 2020

Describe the bug
group_left(labels) seems to take labels from the "many" side while it should take from the "one" side

To Reproduce

label_replace(
                kube_pod_owner{job="kube-state-metrics", owner_kind="ReplicaSet"},
                "replicaset", "$1", "owner_name", "(.*)"
 ) * on(replicaset, namespace) group_left(owner_name) kube_replicaset_owner{job="kube-state-metrics"}

VM currently returns wrong owner_name value:

{namespace=dev, pod=flight-9df5c6f9c-7dgkf, owner_name=flight-9df5c6f9c}

Expected behavior
Basically, both the left & right side of the binary operator contain "owner_name" label but with different values. Since I specify group_left(owner_name), the owner_name of the right side should take priority in the output.

Here is the result of the left side:

{namespace=dev, pod=flight-9df5c6f9c-7dgkf, owner_name=flight-9df5c6f9c, owner_kind=Replicaset, replicaset=flight-9df5c6f9c}

The result of the right side:

{namespace=dev, replicaset=flight-9df5c6f9c, owner_name=flight, owner_kind=Deployment}

The Prometheus docs here also states that the labels in group_left(labels) should be taken from "one" side. So VM should return this instead (it is also what Prometheus returns):

{namespace=dev, pod=flight-9df5c6f9c-7dgkf, owner_name=flight}

Version
The line returned when passing --version command line flag to binary.

victoria-metrics-20200620-223134-tags-v1.37.2-0-ge149019c0
@valyala valyala added bug Something isn't working need more info labels Jun 21, 2020
@valyala
Copy link
Collaborator

valyala commented Jun 21, 2020

Confirmed that VictoriaMetrics doesn't override owner_name label value from the left side with the value from right side. This differs from Prometheus behavior, which can be inspected by the following links:

This bug will be fixed soon.

valyala added a commit that referenced this issue Jun 21, 2020
… and `group_right` lists like Prometheus does

Updates #577
valyala added a commit that referenced this issue Jun 21, 2020
… and `group_right` lists like Prometheus does

Updates #577
@valyala
Copy link
Collaborator

valyala commented Jun 21, 2020

The bug should be fixed in the commit 7532dbc . @phantasia15 , could you buld VictoriaMetrics from this commit according to the instructions and verify whether the bug is fixed there?

@phantasia15
Copy link
Author

@valyala Confirmed that the bug is fixed with the above commit.
Thank you very much!

@valyala
Copy link
Collaborator

valyala commented Jun 21, 2020

@phantasia15 , thanks for the confirmation.

Re-opening the issue until the bugfix is included in the next release.

@valyala valyala reopened this Jun 21, 2020
@valyala
Copy link
Collaborator

valyala commented Jun 25, 2020

The bugfix has been included in v1.37.3. Closing the issue as fixed.

@valyala valyala closed this as completed Jun 25, 2020
valyala pushed a commit that referenced this issue Jul 6, 2023
- error on running with empty -dst dir and without -runOnStart
- error on restoring with backup, created before v1.90.0
valyala pushed a commit that referenced this issue Jul 6, 2023
- error on running with empty -dst dir and without -runOnStart
- error on restoring with backup, created before v1.90.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants