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

Store: fix returned labels on external label conflict when skipping chunks #6874

Conversation

MichaHoffmann
Copy link
Contributor

@MichaHoffmann MichaHoffmann commented Nov 5, 2023

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

When skipping chunks we would send invalid labelsets in prometheus store if external and inner labels conflicted

Verification

Added a acceptance testcase

Fixes #6844

@MichaHoffmann MichaHoffmann force-pushed the mhoffm-fix-prometheus-labels-when-skipping-chunks branch from 8fbfcec to 3002646 Compare November 5, 2023 12:55
…hunks

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
@MichaHoffmann MichaHoffmann force-pushed the mhoffm-fix-prometheus-labels-when-skipping-chunks branch from 3002646 to ce2e61e Compare November 5, 2023 12:57
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the buf fix!

@yeya24 yeya24 merged commit c74a050 into thanos-io:main Nov 5, 2023
14 of 16 checks passed
rabenhorst pushed a commit to rabenhorst/thanos that referenced this pull request Nov 15, 2023
…hunks (thanos-io#6874)

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
Signed-off-by: Sebastian Rabenhorst <sebastian.rabenhorst@shopify.com>
nicolastakashi pushed a commit to nicolastakashi/thanos that referenced this pull request Nov 15, 2023
…hunks (thanos-io#6874)

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
nicolastakashi pushed a commit to nicolastakashi/thanos that referenced this pull request Nov 15, 2023
…hunks (thanos-io#6874)

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
douglascamata pushed a commit to douglascamata/thanos that referenced this pull request Dec 13, 2023
…hunks (thanos-io#6874)

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
douglascamata pushed a commit to douglascamata/thanos that referenced this pull request Dec 13, 2023
…hunks (thanos-io#6874)

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
lset = append(lset, labelpb.ZLabelsFromPromLabels(finalExtLset)...)
sort.Slice(lset, func(i, j int) bool {
return lset[i].Name < lset[j].Name
// external labels should take precedence
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to include the fixed behavior in the changelog. Otherwise it's unclear what the "fix" does in the case of conflicts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On conflict external labes take precedence over internal ones ( in thanos )

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