Skip to content

Apply grains preferences on the server instead of the UI client - #9887

Merged
ReubenBond merged 17 commits into
dotnet:mainfrom
miguelhasse:feature/dashboard-serverside-exclusions
Feb 14, 2026
Merged

ReubenBond merged 17 commits into
dotnet:mainfrom
miguelhasse:feature/dashboard-serverside-exclusions

Conversation

@miguelhasse

@miguelhasse miguelhasse commented Jan 28, 2026 •

Copy link
Copy Markdown
Contributor

This pull request introduces filtering support for dashboard counters and top grain methods, refactors how filters are applied in the frontend, and adds serialization aliases to many model and interface classes for improved compatibility and maintainability. The most significant changes are grouped below.

Backend filtering support:

  • Added exclusions parameters to the DashboardCounters and TopGrainMethods methods in IDashboardClient, IDashboardGrain, and their implementations, allowing the backend to filter out specified grain types before returning results.

  • Updated the AggregateByGrainMethod method in ITraceHistory and its implementation to accept and apply exclusions for filtering.

Frontend filtering refactor:

  • Changed the frontend filter logic in index.tsx to pass filter parameters as query strings to the backend instead of filtering results client-side, ensuring consistency and reducing client-side processing.

Serialization and compatibility improvements:

  • Added [Alias] attributes to grain interfaces and model classes throughout the codebase to improve serialization compatibility and support Orleans code generation.
Microsoft Reviewers: Open in CodeFlow

Copilot AI review requested due to automatic review settings January 28, 2026 13:12
@miguelhasse

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

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.

Pull request overview

This pull request refactors the Orleans Dashboard filtering mechanism to move grain type filtering from the client-side to the server-side. The changes enable the backend to filter out specified grain types before returning dashboard counters and top grain method statistics, reducing client-side processing and ensuring more consistent filtering behavior.

Changes:

  • Added exclusions parameters to backend methods (DashboardCounters, TopGrainMethods, AggregateByGrainMethod) to support server-side filtering
  • Refactored frontend to send filter parameters as query strings instead of filtering results client-side
  • Added serialization [Alias] attributes to grain interfaces and model classes for improved compatibility

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
src/Dashboard/Orleans.Dashboard/TimeSpanConverter.cs Added InvariantCulture to TimeSpan parsing for consistency
src/Dashboard/Orleans.Dashboard/ServiceCollectionExtensions.cs Added exclusion parameter handling to API endpoints and sanitization logic
src/Dashboard/Orleans.Dashboard/Model/*.cs Added Alias attributes to model classes for serialization compatibility
src/Dashboard/Orleans.Dashboard/Metrics/History/TraceHistory.cs Implemented filtering logic in AggregateByGrainMethod
src/Dashboard/Orleans.Dashboard/Metrics/History/ITraceHistory.cs Added exclusions parameter to interface
src/Dashboard/Orleans.Dashboard/Implementation/Grains/DashboardGrain.cs Implemented filtering in GetCounters and TopGrainMethods
src/Dashboard/Orleans.Dashboard/Core/*.cs Added Alias attributes and exclusions parameters to grain interfaces
src/Dashboard/Orleans.Dashboard.App/src/index.tsx Refactored filter logic to pass query parameters instead of client-side filtering
playground/DashboardSeparateHost/Properties/launchSettings.json Updated application URL for local development

miguelhasse and others added 12 commits January 28, 2026 16:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Expanded filter logic to also exclude "Orleans.Streams" when system grains are hidden, either alone or with dashboard grains. Previously, only "Orleans.Runtime" and "Orleans.Dashboard" were excluded in these cases.
Refactor frontend and backend to allow exclusion filters when retrieving grain types. Add support for excluding Orleans.Storage grains. Update API, interfaces, and filtering logic to handle exclusion lists. Remove unused variables and improve consistency in grain type filtering across the dashboard.
Added "Orleans.Providers" to the filter query string for cases where both dashboardGrainsHidden and systemGrainsHidden are enabled, or only systemGrainsHidden is enabled. This ensures providers are hidden alongside other system grains.
Refined the .log element to use more horizontal space and increased its height for better visibility. Moved the "Pause/Resume" button higher and further left to improve accessibility and layout consistency.
Changed version property keys to lowercase in backend and updated frontend to match, ensuring consistent naming between silo.tsx and SiloGrainService.cs.
Introduced SiloMetadata methods to DashboardClient and IDashboardClient for fetching silo metadata by address. Added GetMetadata to ISiloGrainProxy and implemented metadata caching in SiloGrainProxy using ISiloMetadataCache. Exposed new /SiloMetadata/{*address} endpoint for REST access. Updated dependency injection and type usage to support metadata retrieval.
Added support for displaying silo metadata in a new panel, fetched from a SiloMetadata endpoint and shown via PropertiesWidget. Updated SiloProps and interfaces accordingly. Also refined card and row spacing in custom.css for a more compact and consistent layout.
@ReubenBond

Copy link
Copy Markdown
Member

@miguelhasse let me know when you believe this is ready for final review + merge

Added UseSiloMetadata to backend to set silo metadata ("cloud.region" and "Location"). Refactored frontend to always display Silo Metadata and Silo Properties panels, removing conditional rendering for metadata. Ensures consistent and clear presentation of silo metadata in the dashboard.
The UseSiloMetadata call, which set "cloud.region" and "Location"
metadata for the silo, has been removed from the Orleans host
builder configuration. All other Orleans and service setup
remains unchanged.
@ReubenBond
ReubenBond added this pull request to the merge queue Feb 14, 2026
Merged via the queue into dotnet:main with commit dd8cff1 Feb 14, 2026
59 checks passed
rkargMsft pushed a commit to rkargMsft/orleans that referenced this pull request Feb 27, 2026
…et#9887)

* Apply Dashboard and System Grains preferences on the server instead of UI client

* Remove unused unfilteredDashboardCounters variable, as it duplicated the data in dashboardCounters and was no longer used.

* Update src/Dashboard/Orleans.Dashboard/TimeSpanConverter.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/Dashboard/Orleans.Dashboard/ServiceCollectionExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/Dashboard/Orleans.Dashboard/ServiceCollectionExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Dashboard Frontend Update getFilter to exclude Orleans.Streams as needed

Expanded filter logic to also exclude "Orleans.Streams" when system grains are hidden, either alone or with dashboard grains. Previously, only "Orleans.Runtime" and "Orleans.Dashboard" were excluded in these cases.

* Update grain type filtering to support exclusions

Refactor frontend and backend to allow exclusion filters when retrieving grain types. Add support for excluding Orleans.Storage grains. Update API, interfaces, and filtering logic to handle exclusion lists. Remove unused variables and improve consistency in grain type filtering across the dashboard.

* Update filter to exclude Orleans.Providers when hidden

Added "Orleans.Providers" to the filter query string for cases where both dashboardGrainsHidden and systemGrainsHidden are enabled, or only systemGrainsHidden is enabled. This ensures providers are hidden alongside other system grains.

* Adjust log view layout and reposition control button

Refined the .log element to use more horizontal space and increased its height for better visibility. Moved the "Pause/Resume" button higher and further left to improve accessibility and layout consistency.

* Update version property names for consistency

Changed version property keys to lowercase in backend and updated frontend to match, ensuring consistent naming between silo.tsx and SiloGrainService.cs.

* Add silo metadata retrieval to Orleans Dashboard API

Introduced SiloMetadata methods to DashboardClient and IDashboardClient for fetching silo metadata by address. Added GetMetadata to ISiloGrainProxy and implemented metadata caching in SiloGrainProxy using ISiloMetadataCache. Exposed new /SiloMetadata/{*address} endpoint for REST access. Updated dependency injection and type usage to support metadata retrieval.

* Add silo metadata panel and improve card/row spacing

Added support for displaying silo metadata in a new panel, fetched from a SiloMetadata endpoint and shown via PropertiesWidget. Updated SiloProps and interfaces accordingly. Also refined card and row spacing in custom.css for a more compact and consistent layout.

* Add silo metadata support and improve dashboard display

Added UseSiloMetadata to backend to set silo metadata ("cloud.region" and "Location"). Refactored frontend to always display Silo Metadata and Silo Properties panels, removing conditional rendering for metadata. Ensures consistent and clear presentation of silo metadata in the dashboard.

* Remove UseSiloMetadata configuration from Orleans setup

The UseSiloMetadata call, which set "cloud.region" and "Location"
metadata for the silo, has been removed from the Orleans host
builder configuration. All other Orleans and service setup
remains unchanged.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 17, 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.

3 participants