cockroachdb / cockroachdb/cockroach

ui: fine-grained statement latency time chart

Open
#161,898 3 comments 0 reactions 0 assignees View on GitHub
C-enhancement T-observability
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

We are looking for a way to troubleshoot SQL latency spikes more effectively, specifically to support a new canary statistics rollout feature. Currently, the "Statement Times" bar chart under the statement details page uses a default 1-hour aggregation interval, which is too coarse to detect immediate performance regressions caused by new table statistics (an A/B testing scenario where some statements use canary stats and others use stable stats). The goal is to provide a real-time, fine-grained latency line chart—ideally with 1-5 minute intervals—to allow users to identify slowness and trigger rollbacks or refreshes before system-wide impact occurs.
To avoid the storage overhead and reduced retention periods associated with a global reduction in aggregation intervals, we propose a tiered compaction strategy for SQL statistics:

- **High-Fidelity Buffering**: Collect and persist fine-grained statistics (e.g., 10-minute buckets) only for the **most recent hour** or for specific opt-in statement fingerprints.
- **Automated Roll-ups**: Periodically "compact" these granular records into standard 1-hour buckets for long-term storage, and eventually into 1-day buckets for historical analysis.
- **Dual-Line Visualization**: Enhance the Statement Details UI to support a line chart showing a side-by-side comparison of latency (e.g., canary vs. stable stats) powered by this short-term, high-resolution data.

Jira issue: CRDB-59138

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.