Skip to content

Respect hidden resources in dashboard telemetry views - #22656

Open
James Newton-King (JamesNK) wants to merge 2 commits into
mainfrom
jamesnk/dashboard-hidden-resource-telemetry
Open

James Newton-King (JamesNK) wants to merge 2 commits into
mainfrom
jamesnk/dashboard-hidden-resource-telemetry

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Description

Hidden AppHost resources were excluded from the resource list but could still contribute meters and instruments, structured log entries, and trace rows to All resources. This made the telemetry pages noisier and inconsistent with the visibility setting.

The modern dashboard now applies Show hidden resources to the shared aggregate telemetry scope and refreshes the open page when the setting changes. Explicit resource links still work, and traces that involve a visible resource retain their full waterfall.

User-facing usage

Open All resources in Metrics, Structured Logs, or Traces. In the resource pane, choose View options > Show hidden resources to include hidden resources' telemetry without reloading. Choose Hide hidden resources to remove it again. Mixed traces remain visible when they include a visible resource.

Screenshots / Recordings

This PR includes UI changes. Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally.

  • For before/after comparisons, place them side-by-side or label them clearly.
  • For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video).
  • TODO: Capture All resources in Metrics, Structured Logs, and Traces while toggling Show hidden resources on and off in an AppHost with both hidden and visible telemetry-producing resources.

Validation

Passed: 287 dashboard component tests covering the resource layout, Metrics, Structured Logs, and Traces, including toggle updates, hidden-only metrics, unread errors, and mixed-resource traces.

dotnet test --project tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.MetricsTests' --filter-class '*.ResourcesLayoutTests' --filter-class '*.StructuredLogsTests' --filter-class '*.TracesTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22656

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22656"

@github-actions

This comment has been minimized.

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.

🟢 Approval recommended

No active review issues were identified for the telemetry resource-visibility changes.

No open issues 🎉

What changed in this PR

This PR makes the modern dashboard’s All resources telemetry views respect resource visibility, aligning Metrics, Structured Logs, and Traces with the resource pane.

Changes:

  • Applies Show hidden resources to aggregate telemetry and metric-pinning scopes, refreshing open pages when toggled.
  • Preserves explicit resource links and complete traces that include visible resources.
  • Adds component regression tests and documents the visibility behavior.
File Description
tests/​Aspire.Dashboard.Components.Tests/​Shared/​ResourceSetupHelpers.cs Adds a shared helper for toggling hidden-resource visibility.
tests/​Aspire.Dashboard.Components.Tests/​Pages/​TracesTests.cs Tests hidden-only trace filtering and preservation of mixed-resource traces.
tests/​Aspire.Dashboard.Components.Tests/​Pages/​StructuredLogsTests.cs Tests log visibility toggles and hidden unread-error preservation.
tests/​Aspire.Dashboard.Components.Tests/​Pages/​MetricsTests.cs Tests visibility toggles when only hidden resources provide metrics.
tests/​Aspire.Dashboard.Components.Tests/​Layout/​ResourcesLayoutTests.cs Tests aggregate telemetry and pinning scopes across visibility changes.
src/​Aspire.Dashboard/​README.md Documents hidden-resource filtering and mixed-trace behavior.
src/​Aspire.Dashboard/​Components/​Pages/​Metrics.razor.cs Preserves explicit resource resolution and the aggregate selection option.
src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor.cs Filters aggregate scopes by visibility and notifies pages when toggled.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

13 / 101 PR test projects · 2 PR jobs, from 12 changed files.

Selected PR test projects (13 / 101)

Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 11 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/Components/Controls/ApplicationSummary.razor.cs.

🔧 src/Aspire.Dashboard/Components/Controls/ApplicationSummary.razor.cs (changed source)
→ 11 via the project graph: Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/ApplicationSummaryTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Layout/ResourcesLayoutTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/MetricsTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/StructuredLogsTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/TracesTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Shared/ResourceSetupHelpers.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Components/Controls/ApplicationSummary.razor.cs, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs, src/Aspire.Dashboard/Components/Pages/ConsoleLogs.razor.cs, src/Aspire.Dashboard/Components/Pages/Metrics.razor.cs
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit f88347a.

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

Turning off Show hidden resources while viewing a hidden resource replaces its selection with a missing-resource placeholder, disables log clearing, and causes a later filter refresh to drop its log stream.

1 open issue

Review effort: Balanced

Comment on lines +475 to +476
_showHiddenResources = showHiddenResources;
UpdateResourcesList();

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants