diff --git a/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts index c273b5803808..72c63a6fa496 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts @@ -65,6 +65,7 @@ export type StmtInsightsResponseRow = { plan_gist: string; cpu_sql_nanos: number; error_code: string; + last_error: string; status: StatementStatus; }; @@ -95,6 +96,7 @@ index_recommendations, plan_gist, cpu_sql_nanos, error_code, +last_error, status `; @@ -242,6 +244,7 @@ export function formatStmtInsights( planGist: row.plan_gist, cpuSQLNanos: row.cpu_sql_nanos, errorCode: row.error_code, + errorMsg: row.last_error, status: row.status, } as StmtInsightEvent; }); diff --git a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.ts index 4957ced3aeb1..25cac1943aec 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.ts @@ -298,6 +298,7 @@ type TxnInsightsResponseRow = { stmt_execution_ids: string[]; cpu_sql_nanos: number; last_error_code: string; + last_error: string; status: TransactionStatus; }; @@ -334,6 +335,7 @@ causes, stmt_execution_ids, cpu_sql_nanos, last_error_code, +last_error, status`; if (filters?.execID) { @@ -403,6 +405,7 @@ function formatTxnInsightsRow(row: TxnInsightsResponseRow): TxnInsightEvent { stmtExecutionIDs: row.stmt_execution_ids, cpuSQLNanos: row.cpu_sql_nanos, errorCode: row.last_error_code, + errorMsg: row.last_error, status: row.status, }; } diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/types.ts b/pkg/ui/workspaces/cluster-ui/src/insights/types.ts index 0f9cafc05b7a..c5d753c82073 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/types.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/types.ts @@ -59,6 +59,7 @@ export type InsightEventBase = { transactionFingerprintID: string; username: string; errorCode: string; + errorMsg: string; }; export type TxnInsightEvent = InsightEventBase & { @@ -114,6 +115,7 @@ export type StmtInsightEvent = InsightEventBase & { databaseName: string; execType?: InsightExecEnum; status: StatementStatus; + errorMsg?: string; }; export type Insight = { @@ -344,6 +346,7 @@ export interface ExecutionDetails { transactionExecutionID?: string; execType?: InsightExecEnum; errorCode?: string; + errorMsg?: string; status?: string; } diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts b/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts index b72d4eaca3e2..555568f3fb7f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts @@ -79,6 +79,7 @@ const statementInsightMock: StmtInsightEvent = { planGist: "gist", cpuSQLNanos: 50, errorCode: "", + errorMsg: "", status: StatementStatus.COMPLETED, }; @@ -121,6 +122,7 @@ const txnInsightEventMock: TxnInsightEvent = { stmtExecutionIDs: [statementInsightMock.statementExecutionID], cpuSQLNanos: 50, errorCode: "", + errorMsg: "", status: TransactionStatus.COMPLETED, }; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/utils.ts b/pkg/ui/workspaces/cluster-ui/src/insights/utils.ts index 52598802b83c..0e02c24a02ed 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/utils.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/utils.ts @@ -408,6 +408,7 @@ export function getStmtInsightRecommendations( transactionExecutionID: insightDetails.transactionExecutionID, execType: InsightExecEnum.STATEMENT, errorCode: insightDetails.errorCode, + errorMsg: insightDetails.errorMsg, status: insightDetails.status, }; @@ -431,6 +432,7 @@ export function getTxnInsightRecommendations( elapsedTimeMillis: insightDetails.elapsedTimeMillis, execType: InsightExecEnum.TRANSACTION, errorCode: insightDetails.errorCode, + errorMsg: insightDetails.errorMsg, }; const recs: InsightRecommendation[] = []; diff --git a/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx index 8802654d7e2c..2eb9f0dfe145 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx @@ -285,6 +285,10 @@ function descriptionCell( Error Code: {" "} {insightRec.execution.errorCode} +