diff --git a/cmd/testdata/query_lambda.sql b/cmd/testdata/query_lambda.sql new file mode 100644 index 0000000..e69de29 diff --git a/cmd/testdata/query_lambda_updated.sql b/cmd/testdata/query_lambda_updated.sql new file mode 100644 index 0000000..a75f371 --- /dev/null +++ b/cmd/testdata/query_lambda_updated.sql @@ -0,0 +1,12 @@ +SELECT + COUNT(e.type) AS type_cnt, + COUNT(e.kind) AS kind_cnt, + e.label +FROM + commons._events e +GROUP BY + e.label +ORDER BY + type_cnt DESC, + kind_cnt DESC, + e.label diff --git a/main.go b/main.go index 2d1664b..99510c1 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/rockset/cli/flag" "os" "os/signal" "runtime/debug" @@ -75,6 +76,10 @@ func main() { var re rockerr.Error if errors.As(err, &re) { _, _ = fmt.Fprintf(os.Stderr, "%s\n", tui.RocksetStyle.Render("Rockset error:", err.Error())) + dbg, _ := root.PersistentFlags().GetBool(flag.Debug) + if id := re.GetTraceId(); id != "" && dbg { + _, _ = fmt.Fprintf(os.Stderr, "%s\n", tui.RocksetStyle.Render("Trace ID:", id)) + } } else { // this captures usage errors too, as there is no way to distinguish it from other errors sentry.CaptureException(err)