Skip to content

Commit

Permalink
Cmd cmd annotates arbitrary fields until after the cmd is run
Browse files Browse the repository at this point in the history
  • Loading branch information
edulop committed Oct 18, 2019
1 parent 75759c9 commit 3b82fca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ will be launched via "bash -c" using "exec".`,
defer ev.Send()

providerInfo(*ciProvider, ev)
arbitraryFields(*filename, ev)

spanBytes := make([]byte, 16)
rand.Read(spanBytes)
Expand All @@ -59,6 +58,10 @@ will be launched via "bash -c" using "exec".`,
err := runCommand(subcmd)
dur := time.Since(start)

// Annotate with arbitrary fields after the command runs
// this way we can consume a file if the command itself generated one
arbitraryFields(*filename, ev)

ev.Add(map[string]interface{}{
"trace.parent_id": stepID,
"trace.span_id": fmt.Sprintf("%x", spanBytes),
Expand Down

0 comments on commit 3b82fca

Please sign in to comment.