diff --git a/cmd_cmd.go b/cmd_cmd.go index bcf8cbf..240aa42 100644 --- a/cmd_cmd.go +++ b/cmd_cmd.go @@ -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) @@ -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),