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

pkg/rule: retain original path for rule files #1785

Merged
merged 1 commit into from Nov 25, 2019

Conversation

simonpasquier
Copy link
Contributor

@simonpasquier simonpasquier commented Nov 25, 2019

This change ensures that the /api/v1/rules endpoint returns the original path of the rule file instead of the path of the temporary file generated by Thanos ruler.

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

Changes

The mapping from the original rule filenames to the temporary filenames is stored in the github.com/thanos-io/thanos/pkg/rule.Manager struct.

Verification

Added end-to-end tests.

This change ensures that the /api/v1/rules endpoint returns the original
path of the rule file instead of the path of the temporary file
generated by Thanos ruler.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@simonpasquier
Copy link
Contributor Author

The CI failure doesn't seem to be related to the change.

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

}

func ruleWithDir(http, grpc address, dir string, rules []string, am address, queryAddresses []address, queryFileSDAddresses []address) *serverScheduler {
func rule(http, grpc address, ruleDir string, am address, queryAddresses []address, queryFileSDAddresses []address) *serverScheduler {
return &serverScheduler{
HTTP: http,
GRPC: grpc,
schedule: func(workDir string) (Exec, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Much, cleaner thanks 👍

@bwplotka bwplotka merged commit e5d96c8 into thanos-io:master Nov 25, 2019
@simonpasquier simonpasquier deleted the fix-rule-filenames branch November 26, 2019 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants