Skip to main content

Time Travel

Background merges, mutations, replication, and data moves share CPU, memory, and I/O resources with user queries. Time Travel correlates recorded resource metrics with query and background activity to support historical workload analysis. Available history depends on the configured log tables, sampling sources, and retention.

Timeline Chart​

The main view is a time-series chart showing server metrics with query, merge, and mutation activity overlaid as colored bands. The Y-axis metric can be switched between four modes:

  • CPU - total CPU utilization (cgroup-aware on containers/Kubernetes)
  • Memory - RSS and tracked memory
  • Network - bytes sent and received
  • Disk I/O - read and write throughput

Each query, merge, and mutation in the time window is drawn as a horizontal band whose height reflects its share of the selected metric. Colors distinguish queries (blue), merges (orange), and mutations (pink). Category toggles in the header let you hide any of the three to reduce clutter.

Events​

In the 2D view, event markers show changes, failures, and server activity at the time they happened. These include:

  • Server restarts and crashes
  • Queries that ran out of memory, timed out, or were rejected
  • Table and configuration changes
  • Replication and Keeper problems
  • Storage and background task failures
  • Maintenance activity

Only supported event types are shown. Not every ClickHouse log entry becomes a marker.

Use the Events control to show or hide the markers and filter them by severity, category, or event type. Events also appear in the navigator, making it easier to find an event outside the detailed chart window.

Select a marker to keep the chart at that time and see which queries, merges, and mutations were active. Use View details to open the Events page and see more information.

Interaction​

  • Hover over the chart to see a tooltip with exact values at that second
  • Click to pin a timestamp. The side panel updates to show all activity at that moment.
  • Select an event to keep the chart at that time and open a summary.
  • Drag a region to zoom in. Zooming fetches per-second sampled data for higher resolution than the default minute-level aggregation, from the selected Query X-Ray source for queries and merges_history for merges.
  • Click a query or merge band on the chart, or a row in the side panel, to open the detail modal.

A 1-hour miniature timeline sits below the main chart, showing the full time window. A draggable viewport indicator shows which portion you are viewing. Drag the viewport to scroll through time without changing zoom level.

Live Mode​

When live mode is enabled (the default), the chart follows the current time and auto-refreshes with the global polling interval. Clicking on the chart or dragging to zoom pauses live mode so you can inspect a specific moment. Toggle live mode back on to resume following.

A custom end-time picker lets you jump to a specific point in history.

Window Size​

The window size control sets how many seconds of data the main chart shows (default: 150s). Larger windows give more context but with less detail per data point.

Listed Operations​

The Show button (e.g. top 100 by CPU · over 1 MB) in the header says which operations the chart and the Operations list include, and opens the settings:

  • Top per kind: how many queries, merges and mutations each, ranked by the active metric.
  • Min memory and min duration: an operation is listed when it is over either threshold. The defaults are 1 MB and off, so small, short operations stay out of the way. Set min memory to Off to list every operation.
  • In-flight operations: running queries and merges, in live mode.
  • Failed before start: queries that failed before they started (ExceptionBeforeStart in query_log), such as access denied or an unknown table, shown as failures.
  • TraceHouse's own queries: hidden unless this is on.

The counters in the summary use the same thresholds. Reset to default in the panel returns to the default. In Grafana, an admin sets the default in the app settings. Each person's changes are kept in their browser, and a link can carry its own values (tt_min_mem, tt_min_dur, tt_failed_start, tt_self).

Tracking​

Time Travel can track a user, a table or a query pattern. Every matching query in the window is listed and highlighted, whatever its size, and a tracked table also marks its merges and mutations. The strip under the header shows each tracked value with a button to remove it, the number of matches, and All + highlighted or Matched only.

Links set tracking with tt_user, tt_table (database.table) and nqh (normalized query hash). The object browser's Time Travel links use them, and Query Details opens a query's pattern this way.

Cluster Features​

On multi-node clusters, a host selector lets you view metrics for a specific node. Split view renders one chart per host stacked vertically, so you can compare activity across nodes side by side.

View Modes​

  • 2D (default) - standard SVG chart
  • 3D (experimental) - 3D scatter plot of activity
  • 3D Surface (experimental) - 3D surface rendering of the metric

3D modes require the experimental features toggle in Settings.

Cgroup-Aware CPU​

On containerized deployments (Docker, Kubernetes), Time Travel uses cgroup CPU metrics (CGroupUserTime + CGroupSystemTime) instead of OS-level metrics. This gives accurate CPU utilization relative to the container's CPU limit rather than the host's total cores. The effective core count is detected automatically.

Use Cases​

  • Post-incident analysis - replay what was happening during a performance degradation
  • Merge investigation - see which merges were running when insert latency spiked
  • Query forensics - find the exact queries that caused resource contention
  • Capacity planning - understand peak workload patterns over time