-
Notifications
You must be signed in to change notification settings - Fork 175
Conversation
Gerald Rule: Copy Observability on Veneur and Unilog pull requestscc @stripe/observability |
Some notes:
|
af9837c
to
90e77d8
Compare
90e77d8
to
5ff4d93
Compare
Summary from my conversation with @yasha-stripe: This is a bit of an awkward usage of I'm +1 |
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.
Two comments, the rest looks great (:
cmd/veneur-emit/main.go
Outdated
elapsed := time.Since(start) | ||
exitTag := fmt.Sprintf("exit_status:%d", exitStatus) | ||
tags = append(tags, exitTag) | ||
logrus.Debugf("'%s' took %s", command, elapsed) |
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.
Use %q
here instead of '%s'
for an auto-quoted string (:
cmd/veneur-emit/main.go
Outdated
logrus.WithError(err).Fatal("Error!") | ||
} | ||
|
||
command := strings.Join(flag.Args(), " ") |
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.
As we discussed, let's cut out the middle-sh and execute the command directly (:
bb8dfa8
to
77cc117
Compare
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.
😍
cmd/veneur-emit/main.go
Outdated
mode = flag.String("mode", "metric", "Mode for veneur-emit. Must be one of: 'metric', 'event', 'sc'.") | ||
debug = flag.Bool("debug", false, "Turns on debug messages.") | ||
command = flag.String("command", "", "Command to time. This will exec 'command', time it, and emit a timer metric.") | ||
shellCommand = flag.Bool("shellCommand", false, "Turns on timeCommand mode. TODO") |
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.
What's TODO
here?
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.
Thanks! I forgot to write the rest of the documentation :)
👍 |
Summary
This PR adds a
-command
flag toveneur-emit
. If you pass a command to-command
,veneur-emit
will:Motivation
A lot of use cases of
veneur-emit
involve a shell script, where the user would get the time, run some program, get the time again, calculate the difference, and then send the elapsed time as a Timing metric viaveneur-emit
. This PR makes it easier to do so.Test plan
I added tests for
timeCommand
.Rollout/monitoring/revert plan
Puppet!
r? @cory-stripe
TODO:
Do we care about the exit status of the executable?
We do -
veneur-emit
will grab the exit status and put it on the Timing metric as a tag:exit_status:0
, for example.cmd.Start()
&cmd.Wait()
ORcmd.Run()
?cmd.Run()
gets the job done, for now.Do we want to have a timeout on the executable?
Too many edge cases for a timeout, so if the user wishes, they can add a timeout to the command passed to
veneur-emit
.Do we want the user to be able to send other metrics as well, or should we skip that entirely?
Skip metrics. Calling
veneur-emit
is trivial, and if they want to send other metrics, they can just call it repeatedly.Support sending the Timing via SSF?SSF does not (yet) support Timing metrics.