Skip to content

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Apr 22, 2025

Backport of #8771

Customer Impact

Spans can be displayed out of order, creating a confusing experience when viewing the traces.
Also, collapsing spans isn't working, preventing users from collapsing spans to focus on certain data in the trace view.

Testing

A unit test has been added and a diff is included in the original PR if manual testing is desired as well.

Manual test before:
image

Manual test after:
image

Risk

This is a small, isolated, tested change where the root cause is well understood.

Regression?

Yes

@JamesNK JamesNK added area-dashboard Servicing-consider Issue for next servicing release review labels Apr 22, 2025
Copy link
Contributor

@Copilot 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 pull request backports a fix to ensure that visible trace spans are sorted by start time and resolves an issue with the expand/collapse icons in the Traces view.

  • Added tests to validate the correct ordering of spans and toggle behavior for span collapse/expand.
  • Updated the TraceDetail component to filter out hidden spans and accurately compute the total item count.
  • Enhanced the Stress playground applications with new HTTP commands and OpenTelemetry sources to simulate nested trace spans.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/Aspire.Dashboard.Components.Tests/Pages/TraceDetailsTests.cs Added tests for span ordering and collapse toggle behavior
src/Aspire.Dashboard/Components/Pages/TraceDetail.razor.cs Updated GetData filtering logic and added a refresh data call after collapse toggle
playground/Stress/Stress.AppHost/Program.cs Added a new HTTP command for simulating out-of-order nested spans
playground/Stress/Stress.ApiService/Program.cs Added OpenTelemetry enhancements and a new endpoint for nested trace spans

@JamesNK JamesNK changed the title [9.2] Ensure visible trace spans stay sorted by start time and fix Traces view expand/collapse icons [release/9.2] Ensure visible trace spans stay sorted by start time and fix Traces view expand/collapse icons Apr 22, 2025
@danmoseley danmoseley added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Apr 22, 2025
@joperezr joperezr merged commit b590865 into release/9.2 Apr 22, 2025
175 checks passed
@joperezr joperezr deleted the jamesnk/traces-sorting-9.2 branch April 22, 2025 14:56
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-dashboard Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants