-
Notifications
You must be signed in to change notification settings - Fork 59
Description
I'd like to use otel-cli as a simple "send an event, pass/fail" smoke test. ("Is my local/newly-deployed server up & responding")
I can run this with no server on localhost:4317
to demonstrate the fail case:
$ otel-cli exec --endpoint localhost:4317 --service test --name test echo
2021/10/19 19:22:19 context deadline exceeded
But the exit status is 0
. For my described use case, it'd be ideal if the exit status was non-zero - "hey, my test script should fail here". I also recognize that there are many cases where a failure of telemetry code ought not to do that.
Options:
-
Unhandled errors (like
context deadline exceeded
) should exit non-zero; it is the responsibility of the caller to catch and handle:otel-cli exec ... || true
. -
Add a flag for my desired behavior; default to a zero exit status. Non-breaking change; users like me will run as
otel-cli exec --errors-exit-non-zero ...
. (I don't love--errors-exit-non-zero
, will have to think about a name.--exit-status-errors
?--exit-status
?)
Not sure how you all feel about existing use cases, breaking changes, etc.