-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 API admin methods #398
Conversation
Thanks @bobmshannon ! @gouthamve I guess you are most familiar with those endpoints. Does this make sense this way? |
api/prometheus/v1/api.go
Outdated
u := h.client.URL(epCleanTombstones, nil) | ||
q := u.Query() | ||
|
||
u.RawQuery = q.Encode() |
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.
You don't need to encode anything, I guess. You can send an empty body.
c12f348
to
416121d
Compare
Thanks -- I've made some revisions after looking over the code a bit more and the previous PR that originally added this. |
I think in #291 (comment) we decided to have a single type holding the API for v1. But that was before we had Just thought I should've brought that up. Either way, this LGTM. |
Thanks for the context. I think the single interface is preferable otherwise users will need to instantiate multiple API clients, e.g. one to access the admin methods, another for the status methods, etc. Looking at the previous PR I had assumed that a decision had been made otherwise somewhere along the line. Let me update the PR. |
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.
Looks good except for 2 small nits.
return err | ||
} | ||
|
||
_, _, err = h.client.Do(ctx, req) |
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.
L297-302 can be shorten:
_, _, err = h.client.Do(ctx, req)
return err
api/prometheus/v1/api.go
Outdated
return err | ||
} | ||
|
||
if _, _, err = h.client.Do(ctx, req); err != nil { |
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.
ditto
I agree with @simonpasquier about the nits. @bobmshannon let's fix them. Once done, I'll merge (provided there are no further objections). Thanks, everybody, for chiming in. |
0093ff1
to
ab88a61
Compare
@beorn7 @simonpasquier I've addressed the PR comments. |
Thank you very much. However, I'm terribly sorry that we have just added another hoop to jump through: We need the DCO sign-off (see recent post on prometheus-developers@). Perhaps, while adding the sign-off, squash the commits into one (which you can then sign off). |
And of course, the Details link above next to the failed DCO test explains it, too. |
ab88a61
to
633eb73
Compare
Signed-off-by: Bob Shannon <bshannon@palantir.com>
633eb73
to
10dfec7
Compare
@beorn7 Okay -- should be signed off now and all status checks are now passing. |
Thanks again, everyone! |
Fixes #337. Adds support for
DeleteSeries
,CleanTombstones
, andSnapshot
as documented here.@beorn7