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

CLI error output #721

Closed
stuartnelson3 opened this issue Apr 20, 2017 · 2 comments
Closed

CLI error output #721

stuartnelson3 opened this issue Apr 20, 2017 · 2 comments

Comments

@stuartnelson3
Copy link
Contributor

Any time there's an error, the usage text is output. It seems like a legitimate error (as opposed to mis-use of the cli) should just output the error text:

# ./amtool silence expire d08ead34-1119-400a-a1bb-2788853fc520
Error: expired silence must not be modified
Usage:
  amtool silence expire [flags]

Global Flags:
      --alertmanager.url string   Alertmanager to talk to
      --config string             config file (default is $HOME/.amtool.yml)
  -o, --output string             Output formatter (simple, extended, json) (default "simple")
  -q, --quiet                     Only show silence ids
  -v, --verbose                   Verbose running information

This should just be

# ./amtool silence expire d08ead34-1119-400a-a1bb-2788853fc520
Error: expired silence must not be modified

That's my opinion, anyway. Thoughts?

@mxinden @fabxc @brancz @Kellel

@mxinden
Copy link
Member

mxinden commented Apr 20, 2017

Is there a --help flag? If so we can omit the usage text and just add something along the lines of: For further help run "amtool --help"

Kellel pushed a commit to Kellel/alertmanager that referenced this issue Apr 20, 2017
Fixes prometheus#721

I was using the RunE method of cobra.Command which does things with an
error returned from a function. I doesn't seem possible to keep it from
printing usage every time, so I've make a wrapper to use the other
function.
Kellel pushed a commit to Kellel/alertmanager that referenced this issue Apr 20, 2017
Fixes prometheus#721

I was using the RunE method of cobra.Command which does things with an
error returned from a function. I doesn't seem possible to keep it from
printing usage every time, so I've make a wrapper to use the other
function.
@Kellel
Copy link
Contributor

Kellel commented Apr 20, 2017

#724

I did the linking of pr to issue incorrectly

hh pushed a commit to ii/alertmanager that referenced this issue Nov 2, 2017
* Fix off by one in Linux interrupts collector

* Fix off by one in CPU column handler.
* Add test.

* Enable interrupts in end-to-end test.
hh pushed a commit to ii/alertmanager that referenced this issue Nov 7, 2017
* Fix off by one in Linux interrupts collector

* Fix off by one in CPU column handler.
* Add test.

* Enable interrupts in end-to-end test.
hh pushed a commit to ii/alertmanager that referenced this issue Nov 7, 2017
* [BUGFIX] netstat: return nothing when /proc/net/snmp6 not found prometheus#718
* [BUGFIX] Fix off by one in Linux interrupts collector prometheus#721
* [BUGFIX] Add and use sysReadFile in hwmon collector prometheus#728
hh pushed a commit to ii/alertmanager that referenced this issue Nov 7, 2017
* [BUGFIX] netstat: return nothing when /proc/net/snmp6 not found prometheus#718
* [BUGFIX] Fix off by one in Linux interrupts collector prometheus#721
* [BUGFIX] Add and use sysReadFile in hwmon collector prometheus#728
hh pushed a commit to ii/alertmanager that referenced this issue Nov 13, 2017
* [BUGFIX] netstat: return nothing when /proc/net/snmp6 not found prometheus#718
* [BUGFIX] Fix off by one in Linux interrupts collector prometheus#721
* [BUGFIX] Add and use sysReadFile in hwmon collector prometheus#728
hh pushed a commit to ii/alertmanager that referenced this issue Dec 5, 2017
* netstat: return nothing when /proc/net/snmp6 not found

* Fix off by one in Linux interrupts collector (prometheus#721)

* Fix off by one in Linux interrupts collector

* Fix off by one in CPU column handler.
* Add test.

* Enable interrupts in end-to-end test.

* Add and use sysReadFile in hwmon collector (prometheus#728)

* xfs: expose correct fields, fix metric names

* Correct buffer_bytes > INT_MAX on BSD/amd64. (prometheus#712)

* Correct buffer_bytes > INT_MAX on BSD/amd64.

The sysctl vfs.bufspace returns either an int or a long, depending on
the value.  Large values of vfs.bufspace will result in error messages
like:

  couldn't get meminfo: cannot allocate memory

This will detect the returned data type, and cast appropriately.

* Added explicit length checks per feedback.

* Flatten Value() to make it easier to read.

* Simplify per feedback.

* Fix style.

* Doc updates.

* Release v0.15.1

* [BUGFIX] netstat: return nothing when /proc/net/snmp6 not found prometheus#718
* [BUGFIX] Fix off by one in Linux interrupts collector prometheus#721
* [BUGFIX] Add and use sysReadFile in hwmon collector prometheus#728
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants