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

[sync part3] promclient: Added method for Prometheus snapshot. #730

Merged
merged 1 commit into from
Feb 1, 2019

Conversation

bwplotka
Copy link
Member

@bwplotka bwplotka commented Jan 14, 2019

Required for #731

Important follow up on this is #758

Signed-off-by: Bartek Plotka [email protected]

@bwplotka bwplotka requested a review from domgreen January 14, 2019 08:49
@bwplotka bwplotka force-pushed the promclient-snapshot branch 3 times, most recently from 75a13c3 to 0e0b864 Compare January 14, 2019 14:10
@bwplotka bwplotka changed the title promclient: Added method for Prometheus snapshot. [sync part3] promclient: Added method for Prometheus snapshot. Jan 21, 2019
Copy link
Contributor

@domgreen domgreen left a comment

Choose a reason for hiding this comment

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

Looks good ... I expect these will be used in next PR ;)

Only thing I would ask is to update the nits in around the error messages.

CHANGELOG.md Outdated Show resolved Hide resolved
pkg/promclient/promclient.go Show resolved Hide resolved
pkg/promclient/promclient.go Outdated Show resolved Hide resolved
pkg/promclient/promclient.go Show resolved Hide resolved
}
resp, err := http.DefaultClient.Do(req.WithContext(ctx))
if err != nil {
return Flags{}, errors.Wrapf(err, "request config against %s", u.String())
Copy link
Contributor

Choose a reason for hiding this comment

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

config > flags

Copy link
Contributor

@domgreen domgreen left a comment

Choose a reason for hiding this comment

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

🚢 nice ... looking forward to seeing this in action.

u := *base
u.Path = path.Join(u.Path, "/api/v1/admin/tsdb/snapshot")

req, err := http.NewRequest(
Copy link
Member

Choose a reason for hiding this comment

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

might be worth to check the ConfiguredFlags for the web.enable-admin-api?
If called more times it would cause overhead but on the other hand the check will provide always relevant hint what is the issue.
Or maybe just checking for 404 status on the napshot API url would be enough to give that hint.

Copy link
Member Author

Choose a reason for hiding this comment

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

hm do you mean to use Configured Flags to check admin api flag e.g to tell if we can use snapshotting or not?

That is the plan, just not on this PR (:

Copy link
Member

Choose a reason for hiding this comment

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

Yep, that's exactly what I had in mind. Ok :)

@bwplotka bwplotka force-pushed the promclient branch 2 times, most recently from ef254d1 to 02b0186 Compare January 31, 2019 18:11
@bwplotka bwplotka force-pushed the promclient-snapshot branch 3 times, most recently from 9dce393 to 737cf23 Compare February 1, 2019 20:31
Also:
* Resigned from tests against 2.0.0 version as in README.
* Added foreach Prometheus version testutil.

Signed-off-by: Bartek Plotka <[email protected]>
@bwplotka bwplotka force-pushed the promclient-snapshot branch from 737cf23 to e15f983 Compare February 1, 2019 20:48
@bwplotka bwplotka changed the base branch from promclient to master February 1, 2019 20:49
@bwplotka bwplotka merged commit 0061958 into master Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants