diff --git a/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts index c82986c7e6fc..a7fb4122645b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts @@ -54,6 +54,7 @@ export type InsertStmtDiagnosticRequest = { minExecutionLatencySeconds?: number; expiresAfterSeconds?: number; planGist: string; + redacted: boolean; }; export type InsertStmtDiagnosticResponse = { @@ -73,6 +74,7 @@ export async function createStatementDiagnosticsReport( min_execution_latency: NumberToDuration(req.minExecutionLatencySeconds), expires_after: NumberToDuration(req.expiresAfterSeconds), plan_gist: req.planGist, + redacted: req.redacted, }), ).then(response => { return { diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx index ff570e79e3f1..598ebba22a4b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx @@ -55,6 +55,7 @@ export const ActivateStatementDiagnosticsModal = React.forwardRef< const [minExecLatencyUnit, setMinExecLatencyUnit] = useState("milliseconds"); const [expiresAfter, setExpiresAfter] = useState(15); const [traceSampleRate, setTraceSampleRate] = useState(0.01); + const [redacted, setRedacted] = useState(false); const handleSelectChange = (value: string) => { setMinExecLatencyUnit(value); @@ -95,6 +96,7 @@ export const ActivateStatementDiagnosticsModal = React.forwardRef< ), expiresAfterSeconds: getExpiresAfter(expires, expiresAfter), samplingProbability: getTraceSampleRate(conditional, traceSampleRate), + redacted: redacted, }); setVisible(false); }, [ @@ -108,6 +110,7 @@ export const ActivateStatementDiagnosticsModal = React.forwardRef< traceSampleRate, filterPerPlanGist, selectedPlanGist, + redacted, ]); const onCancelHandler = useCallback(() => setVisible(false), []); @@ -313,6 +316,10 @@ export const ActivateStatementDiagnosticsModal = React.forwardRef< /> )} + + setRedacted(!redacted)}> + Redact + diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts index 85706b9c38db..a9a0e6574be6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts @@ -39,6 +39,7 @@ describe("statementsDiagnostics sagas", () => { minExecutionLatencySeconds: minExecLatency, expiresAfterSeconds: expiresAfter, planGist: planGist, + redacted: false, }; const insertResponse: InsertStmtDiagnosticResponse = { diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts index 23eaf413ef17..40573251f4cc 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts @@ -41,6 +41,7 @@ describe("statementsSagas", () => { minExecutionLatencySeconds: minExecLatency, expiresAfterSeconds: expiresAfter, planGist: planGist, + redacted: false, }; const action = createStatementDiagnosticsReportAction( insertStmtDiagnosticsRequest, @@ -72,6 +73,7 @@ describe("statementsSagas", () => { minExecutionLatencySeconds: minExecLatency, expiresAfterSeconds: expiresAfter, planGist: planGist, + redacted: false, }; const action = createStatementDiagnosticsReportAction( insertStmtDiagnosticsRequest,