Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Jul 10, 2025

Description

Trace detail page is updated when new trace data is received. This is so the currently viewed trace is updated with new spans.

However a lot of the time it is unnessary. Other traces are being updated, but the trace detail page is still updated with unchanged data. This PR adds a check to see whether the currently viewed trace has changed or not and skips updating the page if it hasn't.

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
  • Does the change require an update in our Aspire docs?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the trace detail page performance by preventing unnecessary updates when other traces are modified. The optimization adds a check to compare the span count of the currently viewed trace before updating the UI, only refreshing when the trace has actually changed.

Key changes:

  • Added span count comparison to avoid unnecessary UI updates when other traces change
  • Refactored trace retrieval into a separate method for reusability
  • Added comprehensive tests to verify both update and non-update scenarios

Reviewed Changes

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

File Description
src/Aspire.Dashboard/Components/Pages/TraceDetail.razor.cs Added optimization logic to check trace changes before UI updates and extracted GetTrace method
tests/Aspire.Dashboard.Components.Tests/Pages/TraceDetailsTests.cs Added test coverage for trace update scenarios and logging verification

@davidfowl
Copy link
Member

Is this for 9.4?

@JamesNK
Copy link
Member Author

JamesNK commented Jul 10, 2025

No

@JamesNK JamesNK force-pushed the jamesnk/trace-detail-page-perf branch 2 times, most recently from 7e29424 to 8c56808 Compare July 11, 2025 01:08
@JamesNK JamesNK force-pushed the jamesnk/trace-detail-page-perf branch from 8c56808 to b5bffc0 Compare July 15, 2025 00:50
@JamesNK JamesNK enabled auto-merge (squash) July 15, 2025 00:56
@JamesNK JamesNK merged commit 94ab77b into main Jul 15, 2025
276 checks passed
@JamesNK JamesNK deleted the jamesnk/trace-detail-page-perf branch July 15, 2025 01:15
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants