pkg/process: support json trace output (#2713)
Change-Id: Id5a83a8fe23d19d92f5c2622acb0642b4e8f72a2
This commit is contained in:
parent
21a3bf89ee
commit
538e8168a5
@ -268,7 +268,11 @@ func cleanup(cmd *cobra.Command) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = present.SpansToSVG(fh, collect.CollectSpans(ctx, work))
|
||||
if strings.HasSuffix(*traceOut, ".json") {
|
||||
err = present.SpansToJSON(fh, collect.CollectSpans(ctx, work))
|
||||
} else {
|
||||
err = present.SpansToSVG(fh, collect.CollectSpans(ctx, work))
|
||||
}
|
||||
err = errs.Combine(err, fh.Close())
|
||||
if err != nil {
|
||||
logger.Error("failed to write svg", zap.Error(err))
|
||||
|
Loading…
Reference in New Issue
Block a user