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

amtool no longer takes duration units greater than hours #1183

Closed
sinkingpoint opened this issue Jan 8, 2018 · 3 comments
Closed

amtool no longer takes duration units greater than hours #1183

sinkingpoint opened this issue Jan 8, 2018 · 3 comments

Comments

@sinkingpoint
Copy link
Contributor

What did you do?

amtool silence add -e 1w -c 'Testing' instance=somethingthatdoesntexist

What did you expect to see?

A silence being created

What did you see instead? Under which circumstances?

amtool: error: time: unknown unit w in duration 1w

We believe this is a regression introduced by #976 which changes the type of the cli arguments. Before this commit we took Strings and them parsed to them to Durations (The internal model, not the std lib one) ourselves. This PR instead takes std lib Durations which, according to the docs only support units up to hours.

Considering it's reasonably common to want to silence an alert for a day, or a week, or more, having to convert this into hours is tedious.

@sinkingpoint sinkingpoint changed the title amtool no longer takes duration unites greater than hours amtool no longer takes duration units greater than hours Jan 8, 2018
@stuartnelson3
Copy link
Contributor

It should be fairly easy to re-introduce the behavior again -- take the durations as a string, and parse. Sorry for the regression!

@sinkingpoint
Copy link
Contributor Author

Hah. No problem - that was a monster PR to review! I'll probably throw something together tomorrow London time, if this hasn't been picked up by then.

@stuartnelson3
Copy link
Contributor

No worries, I got it

stuartnelson3 added a commit that referenced this issue Jan 9, 2018
* Fixes #1183

* Update expires comment

The default time is already output thanks to
kingpin.
hh pushed a commit to ii/alertmanager that referenced this issue Dec 20, 2018
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

No branches or pull requests

2 participants