cockroachdb / cockroachdb/cockroach

ui: add max execution latency input to statement diagnostics modal

Open
#168,349 0 comments 0 reactions 1 assignee Claimed by @isaactwong View on GitHub
C-enhancement
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Is your feature request related to a problem? Please describe.**

The `max_execution_latency` parameter for statement diagnostics requests is fully supported in the backend (schema, registry, filtering, validation) and is being exposed through the SQL builtin and HTTP API (#168348). However, the DB Console UI has no way to set this value — users can only configure it via SQL or the API.

**Describe the solution you'd like**

Add a max execution latency input field to the activate statement diagnostics modal, mirroring the existing min execution latency UI pattern.

1. **Modal component** (`pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx`)
- Add state for `maxExecLatency` and `maxExecLatencyUnit` (mirror existing min latency state)
- Add input field and unit selector after the min latency input

2. **TypeScript API type** (`pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts`)
- Add `maxExecutionLatencySeconds` to `InsertStmtDiagnosticRequest`
- Wire `max_execution_latency` in the protobuf request builder

3. **Client-side validation**
- Validate max >= min when both are set
- Show clear error message if invalid

**Describe alternatives you've considered**

Users can set `max_execution_latency` via the SQL builtin (`crdb_internal.request_statement_bundle`) once #168348 lands. The UI change is a usability improvement, not a blocker.

**Additional context**

Informs #161004
Depends on #168348

Jira issue: CRDB-58656

Jira issue: CRDB-62910

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.