Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: add error code to stmt and txn insights details pages #97138

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

gtr
Copy link
Contributor

@gtr gtr commented Feb 14, 2023

Part of: #87785.

Previously, the stmt and txn insights details pages did not show any
further information for failed executions. This commit adds an "error
code" column to the insights table for a failed execution in the stmt
and txn insights details pages. Additionally, a "status" column was
added to the stmt and txn workload insights tables which is either
"Completed" or "Failed".

Future work involves adding the error message string in addition to the
error code but it needs to be redacted first. Additionally, the txn
status is missing the implementation of a "Cancelled" status.

Note to reviewers: only consider the second commit, as the first is
required to get the txn status.

Release note (ui change): Adds error code column to the insights table
for a failed execution in the stmt and txn insights details page. Adds
status column to the stmt and txn workload insights tables.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@gtr gtr marked this pull request as ready for review February 14, 2023 19:13
@gtr gtr requested review from a team February 14, 2023 19:13
Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add screenshots/loom to the PR

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 9 of 9 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @gtr)


pkg/ui/workspaces/cluster-ui/src/insights/types.ts line 339 at r2 (raw file):

  errorCode?: string;
  status?: string;
  executionCount?: number;

I don't see this being used anywhere

@j82w
Copy link
Contributor

j82w commented Feb 14, 2023

What is the reason for adding the status column when there is already the insights column that shows that it failed?

@gtr gtr force-pushed the error-code-ui branch 2 times, most recently from eb10f83 to 0e54396 Compare February 15, 2023 16:23
Copy link
Contributor Author

@gtr gtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add screenshots/loom to the PR

Done.

What is the reason for adding the status column when there is already the insights column that shows that it failed?

Good question. I based it off the figma mock-up, which I think makes it more clear when a statement was "Completed" or "Failed" as opposed to looking at the insights column and seeing any insight other than "Failed Execution" and assuming that the execution was in fact completed. Open to other opinions though, cc: @kevin-v-ngo @dongniwang.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @maryliag)


pkg/ui/workspaces/cluster-ui/src/insights/types.ts line 339 at r2 (raw file):

Previously, maryliag (Marylia Gutierrez) wrote…

I don't see this being used anywhere

Good catch, removed.

@gtr gtr force-pushed the error-code-ui branch 2 times, most recently from a2f6d47 to 2a292f5 Compare February 15, 2023 21:36
@dongniwang
Copy link

What is the reason for adding the status column when there is already the insights column that shows that it failed?

The Status column was proposed based on user feedback from design review - It was mentioned that "failed execution" is more of a status rather than an insight. I'd suggest to keep a status column to clearly indicate whether an execution was completed or failed. In my opinion, a failed execution should be perceived as an urgent issue users should pay attention to immediately when troubleshooting. Ideally, we should keep the status column and move the "failed execution" out of the insights. But moving it out of insights has an impact on the design of the page, so let's evaluate!

cc: @kevin-v-ngo


const cx = classNames.bind(styles);

function stmtStatusToBadge(status: StatementStatus) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this more stmtStatusToString

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, done.

Comment on lines 96 to 100
let insightType = "insight-type";
if (value === "Failed Execution") {
insightType = "insight-type-failed";
}
return <div className={cx(insightType)}>{value}</div>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, replace wtih:

const className = value === "FailedExecution" ? "insight-type-failed" :  "insight-type";

Can you do me a favour and refactor this function 🙏 :

  • capitalize this function also, since it's returning a component
  • Change the param to take the InsightTypes enum instead of just a string, do the enum to string conversion in this function instead of the call site

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The function looks way cleaner now!

@rafiss rafiss removed the request for review from a team February 28, 2023 15:59
@gtr gtr force-pushed the error-code-ui branch 4 times, most recently from 83bd782 to 919e746 Compare March 4, 2023 00:23
Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dongniwang should the status column exist on both statement and transaction? Right now seems to be only on statements

Reviewed 4 of 9 files at r6, 14 of 14 files at r7, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @xinhaoz)

@dongniwang
Copy link

@dongniwang should the status column exist on both statement and transaction? Right now seems to be only on statements

Do we have a concept of fail statement execution or we always roll up to transaction execution? If we have a fail for statement, I'd expect to see status exist for both.

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have status on statement level, which is what I mentioned is being displayed in this PR. My questions what on the transaction level, because if any of the statements inside a transaction have failed, should we show also a column for failed on the transaction?

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @xinhaoz)

@gtr
Copy link
Contributor Author

gtr commented Mar 8, 2023

We do have status on statement level, which is what I mentioned is being displayed in this PR. My questions what on the transaction level, because if any of the statements inside a transaction have failed, should we show also a column for failed on the transaction?

I updated the PR to also include a "status" column to the transactions workload insights table. That backend change can be found on #98217 and I've included that commit here too.

I also updated the demo video to show both the transaction and the statement workload insights tables as well as a transaction with multiple statements.

@gtr gtr force-pushed the error-code-ui branch 2 times, most recently from ad67d1a to 97a2a6e Compare March 13, 2023 19:53
Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!
:lgtm:

Reviewed 8 of 10 files at r9, 10 of 10 files at r10, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @xinhaoz)

@gtr
Copy link
Contributor Author

gtr commented Mar 13, 2023

TFTR!
bors r+

@gtr
Copy link
Contributor Author

gtr commented Mar 13, 2023

Going to wait until the checks pass.
bors r-

@craig
Copy link
Contributor

craig bot commented Mar 13, 2023

Canceled.

Part of: cockroachdb#87785.

Previously, the stmt and txn insights details pages did not show any
further information for failed executions. This commit adds an "error
code" column to the insights table for a failed execution in the stmt
and txn insights details pages. Additionally, a "status" column was
added to the stmt and txn workload insights tables which is either
"Completed" or "Failed".

Future work involves adding the error message string in addition to the
error code but it needs to be redacted first. Additionally, the txn
status is missing the implementation of a "Cancelled" status.

Release note (ui change): Adds error code column to the insights table
for a failed execution in the stmt and txn insights details page. Adds
status column to the stmt and txn workload insights tables.
@gtr
Copy link
Contributor Author

gtr commented Mar 14, 2023

bors r+

@craig craig bot merged commit 421d136 into cockroachdb:master Mar 14, 2023
@craig
Copy link
Contributor

craig bot commented Mar 14, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants