feat(scorecard): add entity-page sparkline charts for time-series metrics - #4573
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
|
🤖 Finished Review · ✅ Success · Started 7:36 PM UTC · Completed 7:44 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $2.16 |
ReviewVerdict: comment · 1 medium, 5 low findings · no blocking issues SummaryThis PR adds sparkline (area chart) visualization for entity-page scorecard metrics with Findings1. README does not document the sparkline feature — mediumFile: The Features section lists four bullet points but none mention sparkline, time-series visualization, or DORA metrics. This is a new user-visible capability: metrics with 2. URL path-segment encoding inconsistency — lowFile:
3.
|
b56fa91 to
3dd8c8b
Compare
|
🤖 Review · ❌ Terminated · Started 8:53 AM UTC · Ended 9:09 AM UTC Commit: |
|
🤖 Finished Review · ✅ Success · Started 8:53 AM UTC · Completed 9:09 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $9.51 |
|
🤖 Finished Review · ✅ Success · Started 9:11 AM UTC · Completed 9:53 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $13.56 |
46c6489 to
159c8f3
Compare
|
🤖 Review · ❌ Terminated · Started 6:12 AM UTC · Ended 6:39 AM UTC Commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4573 +/- ##
==========================================
+ Coverage 60.14% 63.23% +3.08%
==========================================
Files 2673 2675 +2
Lines 106162 106151 -11
Branches 29807 29664 -143
==========================================
+ Hits 63856 67128 +3272
+ Misses 41789 38512 -3277
+ Partials 517 511 -6
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
🤖 Finished Review · ✅ Success · Started 6:12 AM UTC · Completed 6:39 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $1.78 |
281e14d to
d201379
Compare
|
🤖 Review · ❌ Terminated · Started 9:08 AM UTC · Ended 9:30 AM UTC Commit: |
Superseded by updated review
|
🤖 Finished Review · ✅ Success · Started 9:08 AM UTC · Completed 9:30 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $14.68 |
d201379 to
c71e26e
Compare
dzemanov
left a comment
There was a problem hiding this comment.
Confirmed that the functionality works as expected:
Single points:
Screen.Recording.2026-09-16.at.15.57.35.mov
Various data with errors:
Screen.Recording.2026-09-16.at.16.03.30.mov
Translation:
Screen.Recording.2026-09-16.at.16.06.16.mov
Translation of collectors description is to be worked within a different ticket.
Adding check description together with collector description to View datasources will be also done within a different ticket, as it was confirmed on today's meeting.
It would be also nice to update all mocked collector ids as they were updated to the narrowed down version, to do within a different PR:
github:deployments->github:doraDeploymentsgithub:deploymentWorkflowRuns->github:doraDeploymentWorkflowRunsgithub:deploymentPullRequests->github:doraDeploymentPullRequestsjira:incidents->jira:doraIncidents
|
ciiay
left a comment
There was a problem hiding this comment.
Hi @Eswaraiahsapram , the changes look good to me, thanks for the update. I also agree with @dzemanov 's point about updating the collector IDs in the mocked data. If you'd prefer to handle that in a separate story, we can merge this PR now. Please open a Jira story to track the work and add the link here for reference 🤝
/lgtm
Thanks @ciiay , I can take care of updating the collector IDs in the Homepage sparkline PR #4596. Merging now |



Hey, I just made a Pull Request!
Fix - https://redhat.atlassian.net/browse/RHIDP-15576
What
Adds sparkline (area chart) visualization support for entity-page scorecard metrics whose
defaultVisualizationissparkline. This is the foundation PR — shared chart components and utilities are included here and will be reused by the homepage sparkline PR that follows.What changed
New components
SparklineChart— Recharts-based area chart with gradient fill, error-dot markers, hover tooltip, and threshold legendSparklineTooltip/SparklineLegend— supporting chart sub-componentsEntitySparklineCard— entity-page card that fetches time-series data and renders a sparkline with a "View data sources" dialog for collector metadataEntityMetricCard— routing component that rendersEntitySparklineCardor the existingScorecardcard based ondefaultVisualizationNew API methods
getMetricTimeSeries—GET /metrics/catalog/:kind/:namespace/:name/time-seriesgetMetricCollectors—GET /metrics/:metricId/collectorsNew hooks
useMetricTimeSeries—useQuery-based hook for 30-day entity metric time seriesuseMetricCollectors—useQuery-based hook for collector metadata (fetched only when the data-sources dialog is open)New utilities
timeSeriesChartData— maps API points to chart-ready data with interpolation for error gapssparklineLegend— builds threshold legend items with color + line-style pairingsparklineChartModel— shared view-model factory used by both entity and homepage cardsmetricVisualization—isSparklineVisualization()helpertimeSeriesRange— computes the default 30-day ISO-8601 rangeRefactors
DataSourcesDialognow accepts genericSourceRow[]instead of building rows internallycollectorSourceRows.ts(for sparkline metrics) andmetricSourceRows.ts(for existing donut metrics) as separate row buildersGitHub,Jira, empty value--, unavailable statusN/A) are now translated via i18n keys instead of hardcoded stringsTranslations
dataSourcesDialog.*keys toref.tsand all locale files (de, es, fr, it, ja)Screen Recording
Screen.Recording.2026-09-07.at.3.18.23.PM.mov
How to test
defaultVisualization: sparkline)✔️ Checklist