-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add support for stringlabels in Thanos Query #7645
Conversation
This commit finalizes support for the stringlabels build tag so that we can build the binary. I would assume that we will still get panics if we run a store since the Series call still relies on casting one pointer type to another. This will be fixed in a follow up PR. Signed-off-by: Filip Petkovski <[email protected]>
cmd/thanos/config.go
Outdated
} | ||
val, err := strconv.Unquote(parts[1]) | ||
if err != nil { | ||
return nil, errors.Wrap(err, "unquote label value") | ||
return labels.Labels{}, errors.Wrap(err, "unquote label value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
labels.EmptyLabels() maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had that first, but thought the empty struct is more idiomatic? I don't have a strong preference though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO labels.EmtpyLabels read better as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SG, updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, tahnk you
Signed-off-by: Filip Petkovski <[email protected]>
Signed-off-by: Filip Petkovski <[email protected]>
} | ||
// Compatibility label for Queriers pre 0.8.1. Filter it out now. | ||
if ls[0].Name == store.CompatibilityTypeLabelName { | ||
if ls.Len() == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the ancient store.CompatibilityTypeLabelName
which I think is okay given how old the supported version is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add a build with stringlabels to CI?
The CI job should be there now. I wasn't sure how to add the build tag to promu so I just used |
Signed-off-by: Filip Petkovski <[email protected]>
97da9c7
to
b55845d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
${{ runner.os }}-go- | ||
|
||
- name: Cross build check | ||
run: go build -tags=stringlabels ./cmd/thanos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promu also supports this I think https://github.com/prometheus/prometheus/blob/main/.promu.yml#L17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's maybe keep it simple for now and not introduce another build tool
This commit finalizes support for the stringlabels build tag so that we can build the binary.
I would assume that we will still get panics if we run a store since the Series call still relies on casting one pointer type to another. This will be fixed in a follow up PR.
Changes
Verification