Skip to content

fix(dashboard): restore dashboard silo statistics and narrow-screen navigation - #11493

Merged
ReubenBond merged 7 commits into
dotnet:mainfrom
ScarletKuro:dashboard
Oct 21, 2026
Merged

ReubenBond merged 7 commits into
dotnet:mainfrom
ScarletKuro:dashboard

Conversation

@ScarletKuro

@ScarletKuro ScarletKuro commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #11491

Problem

After upgrading to Orleans 10, the dashboard's silo page showed zero clients and message totals, "View all counters" stayed empty and never refreshed, and the sidebar became unreachable on narrow screens.

  • Silo statistics: connected-client and byte values came from the inactive SiloRuntimeMetricsListener.
  • Counter collection: the dashboard subscribed to Orleans while the runtime publishes on Microsoft.Orleans; up/down counters and additional tagged series were omitted.
  • Counter refresh: the counters route fetched once rather than participating in the dashboard refresh interval.
  • Responsive navigation: the layout needed an accessible toggle and dismissal behavior below 992 px.
  • Queue lengths: the silo page displayed three retired runtime measurements as zero.

Solution

Runtime

  • Read connected-client counts directly from the gateway's client collection through IConnectedClientCollection.Count, for both management statistics and deployment-load publication.
  • Keep the existing SiloRuntimeMetricsListener public API and management byte-field behavior stable.

Dashboard

  • Collect the silo's own Microsoft.Orleans meter instance, starting at BecomeActive, before the gateway opens at Active.
  • Export up/down counters and combine tagged metric points into one silo-wide value before computing deltas.
  • Collect histogram sums with a single tag-free stream and empty buckets, while retaining the tags on other instrument streams, including gauges.
  • Display "Bytes received" and "Bytes sent" from the dashboard's message-size histogram sums, formatted in B/KB/MB/GB/TB. These totals cover the period since dashboard collection began.
  • Refresh the counters and silo summary on the dashboard interval, with one counter request in flight and route ownership checks for late responses.
  • Present the current silo measurements, including gateway-backed clients and collected byte totals.
  • Add a keyboard-accessible header toggle below the lg breakpoint. Overlay clicks, menu navigation, and Escape close the sidebar; focus restoration, inert hidden content, and breakpoint transitions keep navigation accessible.
  • Add production-browser regressions and a focused CI job covering counter refresh, slow requests, route changes, keyboard dismissal, and responsive navigation.

This consolidates Copilot findings synthesized from our PR #11492 into the same #11491 fix.

Microsoft Reviewers: Open in CodeFlow

Rationale

Telemetry ownership and collection lifetime

The gateway owns connected-client membership, so runtime statistics read its current count directly. The dashboard owns the byte displays and derives their totals from its opt-in OpenTelemetry collection. This keeps the runtime messaging hot path unchanged and makes the collection time boundary explicit.

The histogram-specific view keeps only the sums needed by the dashboard. Other instruments retain their tagged series so the exporter can combine them into the correct silo-wide value.

Sidebar toggle

A small toggle integrates with AdminLTE's responsive sidebar classes and provides the focus, keyboard, and dismissal behavior required by the dashboard.

Copilot AI 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.

🔵 Needs a closer look

The cross-layer runtime, telemetry, and responsive UI changes need final human validation while CI and browser behavior remain unconfirmed.

0 open findings

What changed in this PR

Restores accurate dashboard silo statistics, live counter refreshes, and narrow-screen navigation.

Changes:

  • Sources client/message-byte totals directly from runtime state.
  • Corrects OpenTelemetry meter selection, aggregation, and refresh behavior.
  • Adds responsive sidebar controls and clearer byte displays.
File Description
test/​Orleans.Runtime.Tests/​Diagnostics/​MessagingInstrumentsTests.cs Tests byte totals without listeners.
test/​Orleans.Dashboard.Tests/​Orleans.Dashboard.UnitTests/​SiloRuntimeStatisticsTests.cs Tests dashboard runtime statistics.
test/​Orleans.Dashboard.Tests/​Orleans.Dashboard.UnitTests/​DashboardTelemetryExporterTests.cs Tests metric aggregation and deltas.
test/​Orleans.Dashboard.Tests/​Orleans.Dashboard.UnitTests/​DashboardHostTests.cs Tests local-meter isolation.
test/​Orleans.Core.Tests/​Runtime/​DeploymentLoadPublisherTests.cs Tests published clients and bytes.
test/​Orleans.Core.Tests/​Runtime/​ActivationCountPlacementDirectorTests.cs Updates statistics construction.
src/​Orleans.Runtime/​Silo/​SiloControl.cs Supplies live runtime totals.
src/​Orleans.Runtime/​Placement/​DeploymentLoadPublisher.cs Publishes live runtime totals.
src/​Orleans.Runtime/​Messaging/​IConnectedClientCollection.cs Adds client count access.
src/​Orleans.Runtime/​Messaging/​Gateway.cs Exposes gateway client count.
src/​Orleans.Core/​Statistics/​SiloRuntimeStatistics.cs Accepts explicit client/byte values.
src/​Orleans.Core/​Statistics/​SiloRuntimeMetricsListener.cs Deprecates the unused listener.
src/​Orleans.Core/​Diagnostics/​Metrics/​MessagingInstruments.cs Tracks cumulative message bytes.
src/​Dashboard/​Orleans.Dashboard/​Implementation/​DashboardTelemetryExporter.cs Aggregates tagged metric series.
src/​Dashboard/​Orleans.Dashboard/​DashboardHost.cs Selects the local Orleans meter.
src/​Dashboard/​Orleans.Dashboard.App/​src/​silos/​silo.tsx Displays formatted byte totals.
src/​Dashboard/​Orleans.Dashboard.App/​src/​silos/​silo-counters.tsx Exports the counter type.
src/​Dashboard/​Orleans.Dashboard.App/​src/​lib/​sidebar.ts Implements responsive sidebar controls.
src/​Dashboard/​Orleans.Dashboard.App/​src/​index.tsx Refreshes counters and initializes navigation.
src/​Dashboard/​Orleans.Dashboard.App/​src/​custom.css Enables sidebar scrolling.
src/​Dashboard/​Orleans.Dashboard.App/​index.html Adds accessible mobile navigation markup.
src/​api/​Orleans.Core/​Orleans.Core.cs Updates the generated API surface.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

Metric Pull request Current main Variance
Lines 83.52% (118,705 / 142,120) 83.44% (118,572 / 142,101) +0.0824 pp
Branches 73.17% (35,352 / 48,312) 73.01% (35,269 / 48,308) +0.1658 pp

Report-only conclusion: improved.

The current-main baseline is commit 8a48ca2157 and uses the same reviewed coverage matrix.

Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities.

The comparison remains report-only while normal line and branch variance is calibrated.

Coverage details

@ScarletKuro ScarletKuro changed the title fix: restore dashboard silo statistics and narrow-screen navigation fix(dashboard): restore dashboard silo statistics and narrow-screen navigation Oct 14, 2026
Copilot AI balanced review requested due to automatic review settings October 15, 2026 15:51
@ReubenBond

Copy link
Copy Markdown
Member

@ScarletKuro — Copilot findings, synthesized from our PR #11492, are now consolidated in c68bcf8:

  • Kept gateway-backed connected-client counts in runtime statistics and deployment-load publication.
  • Derived dashboard byte totals from opt-in OpenTelemetry histogram sums since collection began, keeping the runtime messaging hot path unchanged.
  • Applied the sum-only optimization specifically to histograms, preserving tagged gauges and other instrument streams for correct silo-wide aggregation.
  • Added accessible sidebar focus, keyboard, backdrop, and breakpoint behavior, counter-request/late-response guards, and production-browser regressions with a focused CI job.

These changes form one #11491 fix, so they remain together here. The rebase onto current main includes merged #11497's Pkcs restore fix. Post-rebase focused checks passed: 28 dashboard tests on each of net8.0 and net10.0, plus all seven browser regressions repeated three times (21/21). ESLint passed with existing warnings. Exact-head CI is running for c68bcf8, including the new Dashboard UI regressions job. The PR description now reflects the consolidated design and byte-total collection boundary.

Copilot AI 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.

🟡 Changes recommended

Overlapping silo-summary counter requests can overwrite newer byte totals with stale responses.

1 open finding
Files not reviewed (1)
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

🧠 Review effort: Balanced

@ScarletKuro

Copy link
Copy Markdown
Contributor Author

Ty for picking this up

Should I fix the Copilot comment about the overlapping counter requests, or are you on it? Don't want us both pushing to the branch.

Also, ReceivedMessages/SentMessages in SiloRuntimeStatistics still come from SiloRuntimeMetricsListener, which never gets started, so they're always 0 if you call IManagementGrain.GetRuntimeStatistics. The dashboard doesn't use them anymore so it's not a problem here, just wondering is that intentionally left for a follow-up?

@ReubenBond

Copy link
Copy Markdown
Member

Ty for picking this up

Should I fix the Copilot comment about the overlapping counter requests, or are you on it? Don't want us both pushing to the branch.

Please do, and let me know when I should take a final, deeper look.

Also, ReceivedMessages/SentMessages in SiloRuntimeStatistics still come from SiloRuntimeMetricsListener, which never gets started, so they're always 0 if you call IManagementGrain.GetRuntimeStatistics. The dashboard doesn't use them anymore so it's not a problem here, just wondering is that intentionally left for a follow-up?

We should tackle it as a follow-up. Eg, perhaps by forcing the listener to start if it hasn't started and those APIs are called (some messages might be missed), or perhaps there's a better solution

Copilot AI balanced review requested due to automatic review settings October 15, 2026 22:01
@ScarletKuro

ScarletKuro commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Silo page now uses the same pending guard as the other pages, plus a browser test. Also added a catch on both counter requests so a failed refresh doesn't throw an unhandled rejection every second.

HistoricalStats/SiloStats on that page don't have the guard (already like that before this PR), and the grain type/details pages check the flag but never set it. Want those here or in a follow-up?

Nit: the AddView only strips tags from histograms, but the exporter sums counters across tags too, so tagged counters keep per-tag streams for nothing. Could return new MetricStreamConfiguration { TagKeys = [] } for counters as well (not gauges).

Otherwise ready for your final look.

Copilot AI 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.

🔵 Needs a closer look

Cross-layer telemetry lifecycle and accessibility changes warrant human review with current-head CI validation, which was not independently confirmed.

0 open findings

1 resolved since last review
Files not reviewed (1)
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 17, 2026 10:09

Copilot AI 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.

🔵 Needs a closer look

Cross-layer telemetry and lifecycle changes need maintainer validation, with a remaining test-timing race and current-head coverage unverified.

1 open issue
1 file not reviewed
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 17, 2026 10:31

Copilot AI 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.

🔵 Needs a closer look

Cross-layer telemetry lifecycle and accessibility changes need final human validation; completed current-head regression and coverage evidence is unavailable.

No open issues 🎉

1 resolved since last review
1 file not reviewed
  • src/Dashboard/Orleans.Dashboard.App/package-lock.json: Generated file

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 19, 2026 08:28

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ScarletKuro

ScarletKuro commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

HistoricalStats/SiloStats on that page don't have the guard (already like that before this PR), and the grain type/details pages check the flag but never set it. Want those here or in a follow-up?

Nit: the AddView only strips tags from histograms, but the exporter sums counters across tags too, so tagged counters keep per-tag streams for nothing. Could return new MetricStreamConfiguration { TagKeys = [] } for counters as well (not gauges).

@ReubenBond went ahead and added the missing guards, since they're too small for a follow-up and it's nicer to have it consistent right away. Grain details only loads once, so it didn't need the guard. Left the TagKeys nit for you since it's your design call

Ready for final review now.

upd: ups, dropped one commit because of rebase, fixed now.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 08:40

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 21:07

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

ScarletKuro and others added 6 commits October 21, 2026 18:08
SiloRuntimeStatistics read its client count and message byte totals from
SiloRuntimeMetricsListener, which the runtime never started, so the values
were always zero.

Read the connected client count from the gateway's client collection and
keep cumulative message byte totals in MessagingInstruments next to the
existing header byte totals. Both are exact and cost one interlocked add
per message, without enabling the message size histograms on silos that
have no metrics exporter.

Mark SiloRuntimeMetricsListener obsolete in favor of
IManagementGrain.GetRuntimeStatistics.

Refs dotnet#11491
…ation

- Collect dashboard counters from the silo's Microsoft.Orleans meter rather
  than the unused "Orleans" meter name, dropping same-named meters owned by
  other silos or clients in the process.
- Export up/down counters and combine tagged metric points into one
  silo-wide value instead of keeping the last point.
- Refresh the "View all counters" page on the dashboard refresh interval.
- Remove the queue length fields the runtime no longer reports, and label
  message totals as bytes to match SiloRuntimeStatistics.
- Add a navigation toggle below AdminLTE's lg breakpoint, where its CSS
  hides the sidebar until the body has the sidebar-open class.

Fixes dotnet#11491
Copilot AI balanced review requested due to automatic review settings October 21, 2026 15:09

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The request-count assertion completed before the released XHR response, so a fake-clock tick could run while the request was still pending. Wait for response completion before checking that polling resumes.
Copilot AI balanced review requested due to automatic review settings October 21, 2026 16:07

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ReubenBond
ReubenBond merged commit 6adf7a1 into dotnet:main Oct 21, 2026
94 checks passed
@ScarletKuro
ScarletKuro deleted the dashboard branch October 21, 2026 20:09
ReubenBond pushed a commit to ReubenBond/orleans that referenced this pull request Oct 22, 2026
…avigation (dotnet#11493)

Co-authored-by: Reuben Bond <[email protected]>
(cherry picked from commit 6adf7a1)

Upstream-PR: dotnet#11493
Upstream-Commit: 6adf7a1
ReubenBond pushed a commit that referenced this pull request Oct 23, 2026
…avigation (#11493)

Co-authored-by: Reuben Bond <[email protected]>
(cherry picked from commit 6adf7a1)

Upstream-PR: #11493
Upstream-Commit: 6adf7a1
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 21, 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.

Microsoft.Orleans.Dashboard v10: Silo Counters Not Updating and Sidebar Inaccessible on Narrow Screens

3 participants