Skip to content

[Docs][Zeta] Add live metrics chart design - #11672

Closed
det101 wants to merge 1 commit into
apache:devfrom
det101:feature-11666-live-metrics-chart
Closed

det101 wants to merge 1 commit into
apache:devfrom
det101:feature-11666-live-metrics-chart

Conversation

@det101

@det101 det101 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add the STIP/design contract for issue #11666 before implementation. It defines a Flink-style capability for selectable live metrics charts on the existing Job Detail page, without copying the Flink Metrics page layout or adding a new metrics pipeline.

Changes

  • Add English and Chinese live metrics chart design pages.
  • Register the new Zeta document in the sidebar.
  • Link the design from Web UI documentation.

Design summary

  • Reuse /metrics/realtime/jobs/{jobId}/vertices|edges and the current Overview 2s polling; pinning must not add extra REST traffic.
  • Drawer: keep the key-field summary; change only the bottom series table into a live line chart with pin controls.
  • Pin panel: between the DAG and the existing Overview summary table; session-scoped; max 6 series.
  • Chart library: Apache ECharts (Apache-2.0 / ASF) in seatunnel-engine-ui only.

Non-goals

  • Long-term historical metrics storage or export
  • Alerting / threshold notifications
  • Custom derived metric expressions
  • Redesigning Job Detail into a Flink-like Metrics tab

Test plan

  • Docs en/zh pages and sidebar id added
  • Relative links from web-ui.md verified
  • CI docs checks on this PR

Related

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@nzw921rx

nzw921rx commented Aug 6, 2026

Copy link
Copy Markdown
Member

Thank you for your contribution. I have a question that looks like a design document. If you need to align the design, I think it would be more appropriate to discuss it in the issue. The document is user oriented.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What Problem Does This PR Solve?

This is a docs-only PR: it adds a new bilingual "Live Metrics Chart" page (docs/en|zh/engines/zeta/live-metrics-chart.md), registers it in docs/sidebars.js, and links it from the existing web-ui.md page. The new page is explicitly framed as "the proposed design contract for issue #11666" — i.e. a pre-implementation design spec for a future capability (pin one or more realtime metrics from the Job Detail drawer into a persistent live line chart), not documentation of something that ships today. No engine/API/UI runtime code is touched (verified via gh pr diff --name-only: only the 5 doc/sidebar files listed above).

1. Code Change Review

1.1 Core Logic Analysis

Since this PR carries no runtime code, the review focus shifts to whether the documented content is technically accurate against the current codebase, and whether it is placed/framed correctly for a documentation change. I traced every concrete technical claim in the new page against the current dev source:

Claim in the new page Verified against Result
GET /metrics/realtime/jobs/{jobId}/vertices|edges with windowMs RealtimeMetricsServlet.java (REST_URL_REALTIME_METRICS, path parsing for .../jobs/{id}/edges and .../vertices) Matches
Default window 3 min, max 10 min RealtimeMetricsServlet.DEFAULT_WINDOW_MS (3 min) / MAX_WINDOW_MS (10 min), and clampWindowMs() Matches exactly
Overview polls both endpoints every 2 seconds while the job is running views/jobs/detail.tsx: startRealtimePolling() → setInterval(fetchRealtime, 2000), gated by job running state Matches exactly
Drawer shows "key fields above, raw series table below a divider" detail.tsx lines ~630-651: NDrawerContent → Configuration (key fields) → NDivider → NDataTable (series) for both edge and vertex drawers Matches exactly
Pinned panel sits "between the DAG and the existing Overview summary table" detail.tsx Overview tab: <DAG .../> immediately followed by <NDataTable columns={columns} data={tableData.value} .../> Matches exactly
"The implementation PR must call out the ECharts npm dependency" (implying it isn't there yet) seatunnel-engine-ui/package.json has no echarts entry Confirmed not yet a dependency
Everything about "pin" (pin limit 6, pin lifecycle, session scope) grep -rn "pin" seatunnel-engine-ui/src (excluding unrelated pinia matches) Zero implementation exists anywhere in the UI today

Every verifiable factual claim about existing behavior is accurate, and the author clearly read the real source before writing this (not just skimming other docs). That's a real positive.

Key Findings

  1. The technical design itself is sound and conservative: it reuses the existing two REST endpoints and the existing 2s poll loop, explicitly forbids a second polling loop per pinned metric, and caps pin count — all consistent with the actual server-side window/rate limits I verified above.

  2. However, docs/en/engines/zeta/web-ui.md:76 (and the mirrored docs/zh/engines/zeta/web-ui.md:76) adds a new bullet, in the same present-tense, "this is what the product does today" list as "Vertex busyness" and "Edge downstream wait ratio" (both real, shipped capabilities), that reads:

    "Pinned live chart: pin one or more numeric metrics from the drawer so a live line chart remains visible on Overview after the drawer closes. Multiple vertices or edges can be compared on the same chart."

    This sentence has no "planned"/"proposed"/"not yet available" qualifier. I confirmed above that none of this exists in the code — no pin state, no chart component, no ECharts dependency. A user reading web-ui.md today (the moment this PR merges) will be told a capability exists that does not. This is a documentation-accuracy bug, not a hypothetical concern — I verified its absence directly in detail.tsx.

  3. The new live-metrics-chart.md page itself is properly framed as a proposal (## Status section, first line: "This page is the proposed design contract for issue #11666..."), so the honesty problem is specifically in how it's linked into web-ui.md's current-capability list and registered in the primary Zeta user-guide sidebar next to real, shipped feature pages (busyness-and-backpressure, slot-allocation-strategy, tuning-guide) — not in the design page's own content.

  4. This directly relates to the concern @nzw921rx already raised on this PR ("I have a question that looks like a design document... The document is user oriented"). I agree with that concern, and finding #2 above is the concrete, code-verified manifestation of exactly the risk nzw921rx flagged: once a pre-implementation design note is placed in the same tree and linked from the same current-state page as real user docs, it stops reading as a proposal and starts reading as documentation of a shipped feature.

  5. On precedent: the PR description cites PR #11612 ("Add runtime execution graph design") as "similar design PR pattern." I checked — #11612 is itself still open and unmerged. Citing an unmerged, unreviewed PR as an established convention to justify repeating the pattern here is premature; it isn't yet a decided community convention.

  6. SeaTunnel already has a dedicated location for descriptive/architecture-style content, separate from the Zeta user guide tree: docs/en/architecture/ (design-philosophy, core-api-design, engine/dag-execution, fault-tolerance/checkpoint-mechanism, etc.), registered under its own top-level "Architecture" sidebar category, distinct from the "Zeta Engine" user-guide category this PR adds into. That existing split is a strong argument that pre-implementation design notes belong there (or in the issue itself), not under engines/zeta/.

1.2 Compatibility Impact

None — no API, config, protocol, or serialization change. The design page does implicitly propose concrete contracts (pin limit of 6, no additional REST traffic, reuse of the exact two existing endpoints) that will become informal expectations once published; that's a soft compatibility commitment worth flagging but not a blocker by itself.

1.3 Performance / Side-Effect Analysis

N/A — docs only, no runtime effect.

1.4 Error Handling and Logging

N/A — docs only.

Issue 1 (High): docs/en/engines/zeta/web-ui.md:76 and docs/zh/engines/zeta/web-ui.md:76 state, in present tense and in the same list as shipped features, that a "Pinned live chart" capability exists, when it is entirely unimplemented (verified: no pin state, no chart component, no ECharts dependency anywhere in seatunnel-engine-ui). This will mislead every user who reads current Web UI docs before issue #11666 ships. Best improvement: either remove this bullet from web-ui.md until the real implementation PR lands and can update it together with real UI behavior, or explicitly mark it "Planned (not yet available) — see design proposal" so it cannot be read as current behavior. Raised by another reviewer: related to @nzw921rx's general concern, but this is the specific, code-verified accuracy consequence of it — treating as a new formal issue rather than a duplicate.

Issue 2 (Medium): Registering a pre-implementation design/STIP document (live-metrics-chart.md) directly into the Zeta user guide sidebar category (alongside busyness-and-backpressure, slot-allocation-strategy, tuning-guide) mixes "what SeaTunnel does today" with "what one contributor proposes it should do next," and makes the proposal discoverable through the same navigation users rely on for accurate current-state docs. SeaTunnel already maintains a separate docs/en/architecture/ tree/sidebar category for descriptive/design content; using that location (or keeping design alignment purely in the GitHub issue, as suggested by @nzw921rx) would avoid this ambiguity entirely. Raised by another reviewer: Yes (@nzw921rx) — I agree with the concern raised in the PR's discussion comment.

2. Code Quality Assessment

2.1 Coding Standards

Markdown structure, headers, and tables are well-formed in both locales; relative links (live-metrics-chart.md, web-ui.md, realtime-observability.md) all resolve to files that exist in both docs/en and docs/zh. No comment-completeness concerns apply (docs-only change, no code).

2.2 Test Coverage and Test Stability

N/A — no UT/E2E code touched by this PR; stability rating not applicable.

2.3 Documentation Updates

docs/en and docs/zh were both added and kept in structural parity section-for-section (Status/状态, Problem/问题, Existing Foundation/现有基础, Goals/目标, Non-Goals/非目标, UX Placement/交互落点, Shared Chart Component Contract/共享图表组件契约, Pin Model/Pin 模型, Refresh/Retention/Cost/刷新保留成本, Acceptance Criteria/验收标准, Related/相关链接). This is good bilingual-parity practice. The substantive concern is not translation quality but where and how this content is surfaced (see Issues 1–2 above).

3. Architectural Soundness

3.1 Elegance of the Solution

The proposed design itself (as a design, independent of where it's published) is a precise, minimal-footprint proposal: reuse existing endpoints and the existing 2s poll rather than adding a second metrics pipeline or polling loop, and bound client cost regardless of pin count. That part of the content quality is good.

3.2 Maintainability

Risk: once #11666 actually ships, nothing enforces that this design-contract page and the real implementation stay in sync (e.g., the pin limit could end up being 8, not 6, after implementation review) — two sources of truth with no automated link between them. If this page is kept, the implementation PR should be required to update or retire it, not leave it standing independently.

3.3 Extensibility

The "shared chart component contract" section (series id/name/points, decoupled from fetching) is reasonable groundwork for the two related issues (#11351, #11352) to reuse the same chart component later.

3.4 Historical-Version Compatibility

N/A — no runtime/protocol change.

4. Issue Summary

Number Issue Location Severity
1 web-ui.md describes the unimplemented "Pinned live chart" as a current capability, present tense, no "planned" qualifier docs/en/engines/zeta/web-ui.md:76, docs/zh/engines/zeta/web-ui.md:76 High
2 Pre-implementation design doc registered in the Zeta user-guide sidebar/tree instead of the existing architecture/ design-doc location or kept in the issue docs/sidebars.js:283, docs/en/engines/zeta/live-metrics-chart.md, docs/zh/engines/zeta/live-metrics-chart.md Medium

5. Merge Recommendation

Conclusion: Ready to merge after fixes

  1. Blockers — must be fixed

    • Issue 1 (High): Fix or remove the web-ui.md "Pinned live chart" bullet (both locales) so it cannot be read as a currently available capability, since it verifiably is not implemented yet.
    • Issue 2 (Medium): Please resolve @nzw921rx's placement question explicitly before merging — either move this content out of the engines/zeta user-guide tree (e.g., into docs/en/architecture/, which already exists for this kind of content) and out of the main Zeta sidebar, or make a deliberate, stated project decision that this is a pattern the community wants (in which case at minimum Issue 1 must still be fixed so it's clearly marked as a proposal, not shipped behavior).
  2. Recommended fixes — non-blocking

    • Note in the PR description that the cited precedent (#11612) is itself still open/unmerged, so it should be treated as "another PR proposing the same pattern," not as settled convention.
    • Once #11666's implementation lands, make it a requirement (e.g., a checklist item in the implementation PR) to reconcile or retire this design page against the actual shipped behavior (pin limit, event lifecycle, etc.) to avoid long-term drift between design-contract and reality.

Overall assessment: The individual technical claims in this page are unusually well verified against the real codebase (default window, poll interval, endpoint shapes, drawer layout, DAG/table placement all check out exactly), and the underlying design (reuse existing endpoints/poll loop, bound pin count, no second pipeline) is sound engineering. The problem is not the design's substance but its packaging: publishing a pre-implementation proposal as if it were current Web UI documentation, in the same navigation and same present-tense feature list as shipped capabilities. I'd support Option A: keep the substantive design discussion on issue #11666 (or move the write-up to docs/en/architecture/ clearly separated from user guides) and only update web-ui.md/the Zeta sidebar once the real feature ships together with its own implementation PR. Option B, if the community prefers keeping design docs in-tree going forward, is acceptable too, but only once Issue 1 is fixed so nothing describes unshipped behavior as current, and ideally with a project-level decision (not per-PR precedent) on where such design docs should live.

@det101

det101 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @nzw921rx and @DanielLeens for the review.

I agree with the feedback: this content is a pre-implementation design contract, and docs/en|zh/engines/zeta / web-ui.md are user-oriented docs for shipped behavior. Publishing an unimplemented "Pinned live chart" in present tense would be misleading.

Resolution

Closing now. Thanks again.

@det101

det101 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of design discussion on #11666; user-facing docs will land with the implementation PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants