Skip to content

Data Flow Metrics - #3903

Open
ryanmelt wants to merge 4 commits into
mainfrom
fall_behind_detection
Open

ryanmelt wants to merge 4 commits into
mainfrom
fall_behind_detection

Conversation

@ryanmelt

@ryanmelt ryanmelt commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

What changed

Add new metrics view for internal processing and Interface in the Data Flow Diagrams

Why it changed

Better visibility if anything is falling behind

Testing strategy

Manually tested

Summary by CodeRabbit

  • New Features

    • The Data Flows view now shows processing health for interfaces, routers, and targets, with per-service metrics and clear warning, critical, stale, or unavailable statuses.
    • Open node details to inspect metrics, including report age and threshold guidance. Displayed values can be paused for review.
    • Metrics refresh about every five seconds; unavailable reports and services without samples are identified.
  • Documentation

    • Updated the Data Flows guide with metric thresholds, refresh and staleness behavior, and notes on idle services and counter resets.

Comment thread openc3/python/openc3/microservices/interface_microservice.py Fixed
Comment thread openc3/python/openc3/microservices/interface_microservice.py Fixed
Comment thread openc3/python/openc3/utilities/read_queue.py Fixed
Comment thread openc3/python/openc3/utilities/read_queue.py Fixed
Comment thread openc3/python/openc3/utilities/read_queue.py Fixed
Comment thread openc3/python/openc3/utilities/read_queue.py Fixed
@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.89655% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.62%. Comparing base (d2ed704) to head (fe01d4d).

Files with missing lines Patch % Lines
...TlmServer/InterfaceComponents/FlowMetricsPanel.vue 71.42% 2 Missing and 2 partials ⚠️
...er/InterfaceComponents/TargetProcessingDetails.vue 50.00% 2 Missing and 2 partials ⚠️
...CmdTlmServer/InterfaceComponents/useFlowMetrics.js 82.35% 3 Missing ⚠️
.../CmdTlmServer/InterfaceComponents/DetailsTable.vue 0.00% 1 Missing and 1 partial ⚠️
...mServer/InterfaceComponents/InterfaceFlowChart.vue 85.71% 1 Missing and 1 partial ⚠️
...tlmserver/src/tools/CmdTlmServer/InterfacesTab.vue 0.00% 2 Missing ⚠️
...ls/CmdTlmServer/InterfaceComponents/CosmosNode.vue 50.00% 1 Missing ⚠️
...CmdTlmServer/InterfaceComponents/InterfaceNode.vue 50.00% 1 Missing ⚠️
...ls/CmdTlmServer/InterfaceComponents/RouterNode.vue 50.00% 1 Missing ⚠️
...ls/CmdTlmServer/InterfaceComponents/flowMetrics.js 97.67% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3903      +/-   ##
==========================================
+ Coverage   80.28%   80.62%   +0.33%     
==========================================
  Files         909      915       +6     
  Lines       70551    70675     +124     
  Branches     2741     2774      +33     
==========================================
+ Hits        56643    56980     +337     
+ Misses      13237    12992     -245     
- Partials      671      703      +32     
Flag Coverage Δ
frontend 70.37% <81.57%> (+1.82%) ⬆️
python 78.71% <ø> (-0.04%) ⬇️
ruby-api 83.65% <ø> (+0.21%) ⬆️
ruby-backend 86.50% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread openc3/python/openc3/interfaces/stream_interface.py Fixed
Comment thread openc3/python/openc3/interfaces/udp_interface.py Fixed
Comment thread openc3/python/openc3/microservices/interface_microservice.py Fixed
Comment thread openc3/python/openc3/microservices/interface_microservice.py Fixed
jmthomas
jmthomas previously approved these changes Sep 26, 2026

@jmthomas jmthomas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cool new feature. I added a playwright test and bumped the storage down to 20MB from 100MB to prevent huge overruns with a large number of interfaces. This could especially become a problem with a TCP server. That seemed resonable since the red limit was 10MB.

ryanmelt and others added 2 commits October 11, 2026 17:47
…etails

Simplify nested ternaries in flowMetrics, guard the details dialog against
missing details, and add a Data Flows Playwright test for INST2 processing
and INST2_INT metrics.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ryanmelt

Copy link
Copy Markdown
Member Author

#3902 needs to be merged first and then this can be reviewed.

@ryanmelt
ryanmelt changed the base branch from main to interface_reads_and_metrics October 11, 2026 23:52
update() handles all errors internally; void makes the intentionally
ignored promise explicit to satisfy SonarCloud rule S9383.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Base automatically changed from interface_reads_and_metrics to main October 25, 2026 21:28
@ryanmelt
ryanmelt requested a review from jmthomas October 25, 2026 21:28
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6402214-7cf5-43a7-96bf-bf6af2cd7b1a
Commits

Reviewing files that changed from the base of the PR and between 7577ddf and fe01d4d.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f6055257-f237-47c7-81d8-8526b3aab8d7
Commits

Reviewing files that changed from the base of the PR and between c8eb390 and 7577ddf.

Files selected for processing: 20
  • docs.openc3.com/docs/tools/cmd-tlm-server.md
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/package.json
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/CosmosNode.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/DetailsTable.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/FlowHealthIndicator.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/FlowMetricsPanel.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/InterfaceFlowChart.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/InterfaceNode.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/RouterNode.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/TargetNode.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/TargetProcessingDetails.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/flowMetrics.js
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/useFlowMetrics.js
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfacesTab.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/RoutersTab.vue
  • openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/tests/flowMetrics.test.js
  • openc3-cosmos-init/plugins/packages/openc3-js-common/src/services/openc3Api.js
  • openc3/lib/openc3/api/metrics_api.rb
  • openc3/spec/api/metrics_api_spec.rb
  • playwright/tests/cmd-tlm-server/data-flows.p.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Data Flows view now retrieves detailed service metrics, groups them by interface, router, and target, and displays health indicators and metric details. The API retains aggregate results by default and returns per-service reports when detailed mode is requested. Tests and documentation cover the changes.

Changes: Data Flows Metrics

Layer / File(s) Summary
Detailed metrics API
openc3-cosmos-init/plugins/packages/openc3-js-common/src/services/openc3Api.js, openc3/lib/openc3/api/metrics_api.rb, openc3/spec/api/metrics_api_spec.rb
get_metrics accepts a detailed option. Detailed mode returns scoped per-service reports; default mode keeps the existing aggregation. API specs cover both modes and authorization.
Metric grouping, health, and polling
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/flowMetrics.js, .../useFlowMetrics.js, openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/tests/flowMetrics.test.js, openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/package.json
Metric helpers group reports and assign health states using delay, duration, buffer, and age thresholds. The composable polls for updates, and the package adds a test script. Unit tests cover states, formatting, and report handling.
Graph health indicators and details routing
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/InterfaceFlowChart.vue, .../CosmosNode.vue, .../InterfaceNode.vue, .../RouterNode.vue, .../TargetNode.vue, .../FlowHealthIndicator.vue, openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfacesTab.vue, .../RoutersTab.vue
The flow chart passes health data to interface, router, and COSMOS nodes. Their indicators show health states and open the relevant details view. Node sizing and dialog rendering are updated.
Metric details, pause state, and validation
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/src/tools/CmdTlmServer/InterfaceComponents/DetailsTable.vue, .../FlowMetricsPanel.vue, .../TargetProcessingDetails.vue, playwright/tests/cmd-tlm-server/data-flows.p.spec.ts, docs.openc3.com/docs/tools/cmd-tlm-server.md
The details panels display metric values, status, service, and report age. Pause controls retain a snapshot of displayed health. Playwright tests cover target and interface dialogs, and the documentation describes metrics and status behavior.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant InterfaceFlowChart
  participant useFlowMetrics
  participant OpenC3Api
  participant OpenC3ApiServer as OpenC3::Api
  participant MetricModel
  participant FlowHealthIndicator
  User->>InterfaceFlowChart: Open Data Flows view
  InterfaceFlowChart->>useFlowMetrics: Start metrics composable
  useFlowMetrics->>OpenC3Api: Request detailed metrics
  OpenC3Api->>OpenC3ApiServer: get_metrics with detailed option
  OpenC3ApiServer->>MetricModel: Load scoped service reports
  MetricModel-->>OpenC3ApiServer: Return service reports
  OpenC3ApiServer-->>OpenC3Api: Return detailed metrics
  OpenC3Api-->>useFlowMetrics: Return reports
  useFlowMetrics-->>InterfaceFlowChart: Provide grouped health
  InterfaceFlowChart-->>FlowHealthIndicator: Render node health
  User->>FlowHealthIndicator: Open metric details
  FlowHealthIndicator-->>InterfaceFlowChart: Emit details event
  InterfaceFlowChart-->>User: Show selected flow details
Loading

Suggested reviewers: emilyragan, clayandgen

Merge Risk: Minimal · up to 7577d

The new Data Flows metrics view has no established merge-blocking issue in the supplied evidence. Complete the normal test checks before merging.

Security architecture risk: Low · up to 7577d

The new view exposes more granular service information through the existing metrics permissions. No introduced authorization bypass was established, but the deployed restrictions on access to individual scopes could not be verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — Detailed mode increases information granularity for callers passing the existing metrics authorization check: it exposes individual service identifiers, metric reports, and update timestamps instead of only aggregates. Retrieval remains scope-selected through MetricModel; detailed mode does not introduce a separate datastore lookup or new scope selector.

Trust Boundaries and Controls

  • observed — Compared with the PR base, get_metrics retains authorization before scoped model access. The inspected RPC path retains whitelist dispatch and authorization-header token propagation. These controls do not establish the deployed role-to-scope policy: the enterprise authorization override was unavailable, so absolute cross-scope entitlement enforcement remains unverified rather than an observed PR regression.

Hardening Proposals

  • proposed — Validate both response modes against the deployed scope-authorization policy, including a token authorized for one scope requesting another scope. This would resolve the remaining entitlement uncertainty; it is not evidence of a newly introduced bypass.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 files. (13 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: adding metrics to Data Flow diagrams.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 files. (13 skipped: 13 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@ryanmelt ryanmelt added the review-and-merge-ready When this PR is approved, the approver can click the merge button label Oct 26, 2026

This branch has not been deployed

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

Labels

review-and-merge-ready When this PR is approved, the approver can click the merge button

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants