Skip to content

feat: switch to uplot for prom charts#371

Merged
ellie merged 3 commits intomainfrom
ellie/uplot-charts
Jan 26, 2026
Merged

feat: switch to uplot for prom charts#371
ellie merged 3 commits intomainfrom
ellie/uplot-charts

Conversation

@ellie
Copy link
Copy Markdown
Member

@ellie ellie commented Jan 23, 2026

Tasks

  • Regenerated TS-RS bindings (if any ts(export) structs have changed)
  • Updated the documentation in docs/ (if any application behavior has changed)
  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jan 23, 2026

Greptile Overview

Greptile Summary

Replaces ECharts with uPlot for Prometheus chart rendering. Refactors data transformation from row-based to columnar format (required by uPlot), adds custom tooltip with Grafana-style formatting, and implements proper light/dark theme support.

Changes:

  • Removed echarts and @kbox-labs/react-echarts dependencies, added uplot and uplot-react
  • Backend now returns columnar data: [timestamps, series1_values, series2_values, ...] instead of individual series objects
  • Frontend implements custom tooltip with value formatting (K/M suffixes) and horizontal flip behavior
  • Deleted PrometheusSeries type (no longer needed)

Issue found:

  • Timestamp collection logic in prometheus.rs:457-460 has redundant nested conditionals that may cause confusion during maintenance

Important Files Changed

Filename Overview
crates/atuin-desktop-runtime/src/blocks/prometheus.rs Refactored data structure from row-based to columnar format for uPlot compatibility; potential bug in timestamp collection logic
src/components/runbooks/editor/blocks/Prometheus/lineChart.tsx Complete rewrite replacing ECharts with uPlot; added custom tooltip, theme support, and proper TypeScript types
src/components/runbooks/editor/blocks/Prometheus/Prometheus.tsx Updated to handle new columnar data format with separate data and seriesNames arrays

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread crates/atuin-desktop-runtime/src/blocks/prometheus.rs Outdated
@ellie ellie merged commit 394d18b into main Jan 26, 2026
8 checks passed
@ellie ellie deleted the ellie/uplot-charts branch January 26, 2026 19:10
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant