Skip to content

Fix trace detail span pane on navigation and improve stress/playground apps#18146

Merged
JamesNK merged 1 commit into
mainfrom
fix/trace-detail-navigation-and-stress-links
Jun 12, 2026
Merged

Fix trace detail span pane on navigation and improve stress/playground apps#18146
JamesNK merged 1 commit into
mainfrom
fix/trace-detail-navigation-and-stress-links

Conversation

@JamesNK

@JamesNK JamesNK commented Jun 12, 2026

Copy link
Copy Markdown
Member

Description

Fixes #10162

Three related improvements to dashboard trace navigation and playground apps:

  1. Dashboard: Close span detail pane on trace navigation — When navigating between traces (e.g., clicking a span link to another trace, then pressing browser Back), the span detail pane from the previous trace was left open showing a span that doesn't belong to the current trace. Now SelectedData is cleared whenever the trace changes, and if the new URL includes a ?spanId= parameter the correct span is re-opened.

  2. TestShop: Fix checkout timeout — The BasketService resolved IConnection lazily on first checkout, hitting RabbitMQ connection retries (21s) that triggered the frontend's 10-second resilience timeout. Fixed by enabling auto-activation and using constructor injection.

  3. Stress app: Create real cross-trace span links — When the stress app creates span links to other traces, 50% now create an actual recorded trace+span so the link is navigable in the dashboard. The span name also includes link metadata (count, same-trace, cross-trace).

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
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No

… links

- Close span detail pane when navigating between traces via browser
  back/forward in the dashboard (fixes #10162)
- Enable RabbitMQ auto-activation in TestShop BasketService to avoid
  timeout on first checkout
- Add real cross-trace span links in stress app TraceCreator (50% of
  cross-trace links now create a navigable trace+span)
Copilot AI review requested due to automatic review settings June 12, 2026 06:52
@JamesNK JamesNK requested a review from adamint as a code owner June 12, 2026 06:52
@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 -- 18146

Or

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

@davidfowl

Copy link
Copy Markdown
Contributor

PR testing? Screenshots? Draft?

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 PR fixes issue #10162 where navigating back between traces in the dashboard left a stale span detail pane open showing a span from the previous trace. The fix is minimal: clear SelectedData when the trace changes in OnParametersSetAsync, allowing the existing SpanId query parameter logic to re-open the correct span if needed. Additionally, two playground app improvements are included: fixing a checkout timeout in TestShop by eagerly activating the RabbitMQ connection, and making the stress app's cross-trace span links navigable by creating real trace/span records.

Changes:

  • Clear SelectedData in TraceDetail.razor.cs when navigating between traces so stale span detail panes are closed
  • Fix TestShop BasketService checkout timeout by enabling auto-activation and using constructor injection for IConnection
  • Enhance the stress app's TraceCreator to create real recorded spans for 50% of cross-trace links, making them navigable in the dashboard

Reviewed changes

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

File Description
src/Aspire.Dashboard/Components/Pages/TraceDetail.razor.cs Clear SelectedData when TraceId changes to close stale span detail pane
playground/TestShop/BasketService/Program.cs Set DisableAutoActivation = false to eagerly resolve IConnection at startup
playground/TestShop/BasketService/BasketService.cs Replace lazy IServiceProvider resolution with direct IConnection? constructor injection
playground/Stress/Stress.ApiService/TraceCreator.cs Add CreateLinkedTrace to create real navigable spans for cross-trace links; enrich span names with link metadata

@JamesNK

JamesNK commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

PR Testing Report

PR: #18146
Head Commit: 69bf9ec
Tested At: 2026-06-12

Artifact Version Verification

  • Expected Commit: 69bf9ec
  • Local branch: fix/trace-detail-navigation-and-stress-links at head commit
  • Status: ✅ Verified

Changes Analyzed

  • src/Aspire.Dashboard/Components/Pages/TraceDetail.razor.cs — Clear SelectedData on trace navigation

Test Scenarios Executed

Scenario 1: Dashboard Component Tests (includes TraceDetailsTests)

Status: ✅ Passed
Results: 112/112 passed (0 failed)

Scenario 2: Full Dashboard Unit Tests

Status: ✅ Passed
Results: 1410/1410 passed (0 failed)

Scenario 3: Live Stress AppHost (manual)

Status: ⚠️ Partial — AppHost started, dashboard loaded, but API service unreachable via scripted HTTP due to DCP TLS proxy + unresolved parameters

Summary

Scenario Status Notes
Dashboard Component Tests ✅ 112/112 Includes TraceDetailsTests covering OnParametersSetAsync
Dashboard Unit Tests ✅ 1410/1410 Full regression suite
Live Stress AppHost ⚠️ Partial Dashboard rendered; API service not reachable for trace generation

Overall Result

✅ Dashboard changes verified — The fix (SelectedData = null on trace change) is exercised by existing tests and causes no regressions across 1,522 dashboard tests.

Comment thread playground/Stress/Stress.ApiService/TraceCreator.cs
@JamesNK JamesNK enabled auto-merge (squash) June 12, 2026 07:34
@JamesNK JamesNK merged commit d571753 into main Jun 12, 2026
674 of 677 checks passed
@JamesNK JamesNK deleted the fix/trace-detail-navigation-and-stress-links branch June 12, 2026 07:34
@github-actions github-actions Bot added this to the 13.5 milestone Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLI E2E Tests unknown — 115 passed, 0 failed, 2 unknown (commit 69bf9ec)

View all recordings
- Test Detail
AddPackageInteractiveWhileAppHostRunningDetached Recording · Job · CLI logs
AddPackageWhileAppHostRunningDetached Recording · Job · CLI logs
AgentCommands_AllHelpOutputs_AreCorrect Recording · Job · CLI logs
AgentInitCommand_DefaultSelection_InstallsDefaultSkills Recording · Job · CLI logs
AgentInitCommand_MigratesDeprecatedConfig Recording · Job · CLI logs
AgentInit_NonInteractive_BundleOnlySkillsNotInCatalog Recording · Job · CLI logs
AgentMcpListResources_ExcludesResourceMarkedWithExcludeFromMcp Recording · Job · CLI logs
AgentMcpListStructuredLogsReturnsLogsFromStarterApp Recording · Job · CLI logs
AgentMcpListStructuredLogsReturnsLogsFromStarterApp_DevLocalhost Recording · Job · CLI logs
AgentMcpListStructuredLogsReturnsLogsFromStarterApp_Isolated Recording · Job · CLI logs
AllPublishMethodsBuildDockerImages Recording · Job · CLI logs
AspireAddAndStartWorkAgainstLegacyAppHostTs Recording · Job · CLI logs
AspireAddPackageVersionToDirectoryPackagesProps Recording · Job · CLI logs
AspireInitSingleFileAppHostRunsViaDotnetRunAppHost Recording · Job · CLI logs
AspireInit_ExistingAppHostDir_RecreatesNuGetConfigKeepsFiles Recording · Job · CLI logs
AspireInit_SolutionFile_BuildsAgainstChannelHive Recording · Job · CLI logs
AspireStartUpdatesStaleTypeScriptAppHostPath Recording · Job · CLI logs
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps Recording · Job · CLI logs
AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent Recording · Job · CLI logs
Banner_DisplayedOnFirstRun Recording · Job · CLI logs
Banner_DisplayedWithExplicitFlag Recording · Job · CLI logs
Banner_NotDisplayedWithNoLogoFlag Recording · Job · CLI logs
CertificatesClean_RemovesCertificates Recording · Job · CLI logs
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate Recording · Job · CLI logs
CertificatesTrust_WithUntrustedCert_TrustsCertificate Recording · Job · CLI logs
ConfigSetGet_CreatesNestedJsonFormat Recording · Job · CLI logs
CreateAndRunAspireStarterProject Recording · Job · CLI logs
CreateAndRunAspireStarterProjectWithBundle Recording · Job · CLI logs
CreateAndRunEmptyAppHostProject Recording · Job · CLI logs
CreateAndRunJavaEmptyAppHostProject Recording · Job · CLI logs
CreateAndRunJsReactProject Recording · Job · CLI logs
CreateAndRunPolyglotAppHostWithDevLocalhostUrls Recording · Job · CLI logs
CreateAndRunPythonReactProject Recording · Job · CLI logs
CreateAndRunTypeScriptEmptyAppHostProject Recording · Job · CLI logs
CreateAndRunTypeScriptStarterProject Recording · Job · CLI logs
CreateJavaAppHostWithViteApp Recording · Job · CLI logs
CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain Recording · Job · CLI logs
DashboardRunWithAgentMcpListTracesReturnsNoTraces Recording · Job · CLI logs
DashboardRunWithAgentMcpListTracesReturnsNoTraces_DevLocalhost Recording · Job · CLI logs
DashboardRunWithOtelTracesReturnsNoTraces Recording · Job · CLI logs
DashboardRunWithOtelTracesReturnsNoTraces_DevLocalhost Recording · Job · CLI logs
DeployK8sBasicApiService Recording · Job · CLI logs
DeployK8sWithExternalHelmChart Recording · Job · CLI logs
DeployK8sWithGarnet Recording · Job · CLI logs
DeployK8sWithMongoDB Recording · Job · CLI logs
DeployK8sWithMySql Recording · Job · CLI logs
DeployK8sWithPostgres Recording · Job · CLI logs
DeployK8sWithRabbitMQ Recording · Job · CLI logs
DeployK8sWithRedis Recording · Job · CLI logs
DeployK8sWithSqlServer Recording · Job · CLI logs
DeployK8sWithValkey Recording · Job · CLI logs
DeployTypeScriptAppToKubernetes Recording · Job · CLI logs
DescribeCommandResolvesReplicaNames Recording · Job · CLI logs
DescribeCommandShowsRunningResources Recording · Job · CLI logs
DetachFormatJsonProducesValidJson Recording · Job · CLI logs
DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance Recording · Job · CLI logs
DoPublishAndDeployListStepsWork Recording · Job · CLI logs
DocsCommand_RendersInteractiveMarkdownFromLocalSource Recording · Job · CLI logs
DoctorCommand_DetectsDeprecatedAgentConfig Recording · Job · CLI logs
DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain Recording · Job · CLI logs
DoctorCommand_WithSslCertDir_ShowsTrusted Recording · Job · CLI logs
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted Recording · Job · CLI logs
DotNetRunFileBasedAppHostUsesAspireCliBundle Recording · Job · CLI logs
DotNetRunProjectAppHostUsesAspireCliBundle Recording · Job · CLI logs
GatewayWithoutExternalEndpoint_FailsPublishWithGuidance Recording · Job · CLI logs
GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain Recording · Job · CLI logs
GlobalMigration_HandlesCommentsAndTrailingCommas Recording · Job · CLI logs
GlobalMigration_HandlesMalformedLegacyJson Recording · Job · CLI logs
GlobalMigration_PreservesAllValueTypes Recording · Job · CLI logs
GlobalMigration_SkipsWhenNewConfigExists Recording · Job · CLI logs
GlobalSettings_MigratedFromLegacyFormat Recording · Job · CLI logs
IngressWithoutExternalEndpoint_FailsPublishWithGuidance Recording · Job · CLI logs
InitTypeScriptAppHost_AugmentsExistingViteRepoInWorkspaceSubdirectory Recording · Job · CLI logs
InteractiveCSharpInitCreatesExpectedFiles Recording · Job · CLI logs
InvalidAppHostPathWithComments_IsHealedOnRun Recording · Job · CLI logs
JavaScriptHostingApisRunFromTypeScriptAppHost Recording · Job · CLI logs
LatestCliCanStartStableChannelAppHost Recording · Job · CLI logs
LatestCliCanStartStableChannelTypeScriptAppHost Recording · Job · CLI logs
LegacySettingsMigration_AdjustsRelativeAppHostPath Recording · Job · CLI logs
LogsCommandShowsResourceLogs Recording · Job · CLI logs
OtelLogsReturnsStructuredLogsFromStarterApp Recording · Job · CLI logs
OtelLogsReturnsStructuredLogsFromStarterAppIsolated Recording · Job · CLI logs
ProcessCommandCallbackReceivesCliArguments Recording · Job · CLI logs
PsCommandListsRunningAppHost Recording · Job · CLI logs
PsFormatJsonOutputsOnlyJsonToStdout Recording · Job · CLI logs
PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts Recording · Job · CLI logs
PublishWithConfigureEnvFileUpdatesEnvOutput Recording · Job · CLI logs
PublishWithDockerComposeServiceCallbackSucceeds Recording · Job · CLI logs
PublishWithoutOutputPathUsesAppHostDirectoryDefault Recording · Job · CLI logs
ResourceCommand_FailedExec_ShowsLogPathAndLogHasEntries Recording · Job · CLI logs
ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput Recording · Job · CLI logs
RestoreGeneratesSdkFiles Recording · Job · CLI logs
RestoreGeneratesSdkFiles_WithConfiguredToolchain Recording · Job · CLI logs
RestoreRefreshesGeneratedSdkAfterAddingIntegration Recording · Job · CLI logs
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes Recording · Job · CLI logs
RunFromParentDirectory_UsesExistingConfigNearAppHost Recording · Job · CLI logs
RunReportsSyntaxErrorsForDotNetAppHost Recording · Job · CLI logs
RunReportsSyntaxErrorsForTypeScriptAppHost Recording · Job · CLI logs
SecretCrudOnDotNetAppHost Recording · Job · CLI logs
SecretCrudOnTypeScriptAppHost Recording · Job · CLI logs
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels Recording · Job · CLI logs
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets Recording · Job · CLI logs
StartReportsSyntaxErrorsForDotNetAppHost Recording · Job · CLI logs
StartReportsSyntaxErrorsForTypeScriptAppHost Recording · Job · CLI logs
StopAllAppHostsFromAppHostDirectory Recording · Job · CLI logs
StopJavaPolyglotAppHostUsingApphostDirectory Recording · Job · CLI logs
StopNonInteractiveSingleAppHost Recording · Job · CLI logs
StopTypeScriptPolyglotAppHostUsingApphostDirectory Recording · Job · CLI logs
StopWithNoRunningAppHostExitsSuccessfully Recording · Job · CLI logs
TerminalAttachFrontend_ShowsViteHelpAndDetaches Recording · Job · CLI logs
TypeScriptAppHostRunDoesNotDeadlockWhenLazyOptionsInvokeAsyncCallback Recording · Job · CLI logs
TypeScriptAppHostWithVite_AllowsDifferentGuestPkgManager Recording · Job · CLI logs
UnAwaitedChainsCompileWithAutoResolvePromises Recording · Job · CLI logs
UpdateToStable_CSharpEmptyAppHost_KeepsConfigChannel Recording · Job · CLI logs
UpdateToStable_CSharpSingleFileInit_KeepsConfigChannel Recording · Job · CLI logs
UpdateToStable_TypeScriptSingleFileInit_KeepsConfigChannel Recording · Job · CLI logs
UpdateToStable_TypeScript_PreviewsStablePkgsAndKeepsChannel Recording · Job · CLI logs

📹 Recordings uploaded automatically from CI run #27399827982

aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request Jun 12, 2026
Documents the fix for the span detail pane persisting across trace navigation
in the dashboard (microsoft/aspire#18146).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1250

Generated by PR Documentation Check · sonnet46 4.7M

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.

Navigating back between traces while a trace detail is open

3 participants