Python: .NET: Show Aspire traces in DevUI - #7874
Conversation
|
Here are the screenshots from the live validation run. The first one shows the successful streaming response and the four Aspire spans that DevUI retrieved for it. The second one shows the matching trace ID, successful status, and the redacted Azure HTTP span. I replayed the captured live response and trace payload through the built DevUI so the screenshots are reproducible. |
There was a problem hiding this comment.
Pull request overview
Adds Aspire Dashboard trace retrieval to the shared DevUI frontend for .NET agent services.
Changes:
- Correlates responses with Aspire OpenTelemetry traces.
- Adds cancellable frontend trace polling and runtime-specific guidance.
- Fixes Aspire sample configuration and package mismatches.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
python/packages/devui/frontend/src/types/index.ts |
Adds tracing capabilities. |
python/packages/devui/frontend/src/services/api.ts |
Polls trace endpoints. |
python/packages/devui/frontend/src/components/layout/debug-panel.tsx |
Updates .NET trace guidance. |
python/packages/devui/frontend/src/components/features/agent/context-inspector.tsx |
Updates context guidance. |
python/packages/devui/frontend/src/components/features/agent/agent-view.tsx |
Starts and cancels trace polling. |
python/packages/devui/frontend/src/App.tsx |
Configures tracing from metadata. |
python/packages/devui/agent_framework_devui/ui/assets/index.css |
Regenerates frontend CSS. |
dotnet/tests/Aspire.Hosting.AgentFramework.DevUI.UnitTests/AspireDashboardTracingTests.cs |
Tests trace correlation and failures. |
dotnet/src/Aspire.Hosting.AgentFramework.DevUI/SseResponseIdCapture.cs |
Extracts response IDs from SSE. |
dotnet/src/Aspire.Hosting.AgentFramework.DevUI/README.md |
Documents Aspire tracing. |
dotnet/src/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs |
Implements trace propagation and retrieval. |
dotnet/src/Aspire.Hosting.AgentFramework.DevUI/AspireDashboardTraceClient.cs |
Converts Dashboard spans for DevUI. |
dotnet/src/Aspire.Hosting.AgentFramework.DevUI/AgentFrameworkBuilderExtensions.cs |
Supplies AppHost configuration. |
dotnet/samples/05-end-to-end/DevUIAspireIntegration/DevUIIntegration.AppHost/Properties/launchSettings.json |
Resolves dashboard port conflicts. |
dotnet/samples/05-end-to-end/DevUIAspireIntegration/DevUIIntegration.AppHost/DevUIIntegration.AppHost.csproj |
Fixes framework and Azure references. |
dotnet/Directory.Packages.props |
Pins the Aspire Azure package. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
@microsoft-github-policy-service agree |
|
Addressed all three review findings in What changed:
Validation:
The existing screenshots are still representative because these changes affect trace completeness and status handling, not the layout. |
|
@microsoft-github-policy-service agree |
|
Saibernard please help fix the current file conflict. thanks. |
|
Please re-open when PR feedback is addressed and file conflicts are addressed. Thanks. |
Merge current main, preserve the full trace polling window, stream bounded JSON response capture, and use the current trace retrieval capability. Add regression coverage for delayed spans and response copying.
|
Evan Mattson (@moonbox3) The review feedback has been addressed and the branch is merged with current main with the conflicts resolved (ffe3c15). All review threads are resolved. GitHub does not let me reopen this PR from my side since it was closed by a maintainer. Could you please reopen it? If you would rather I open a fresh PR instead, let me know and I will do that. |
There was a problem hiding this comment.
🟡 Changes recommended
Trace polling can discard accumulated spans after transient failures and remain active far beyond its documented window.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
python/packages/devui/frontend/src/services/api.ts:261
- A transient fetch or JSON-decoding failure discards every span merged by earlier polls, so one bad snapshot can turn a partially recovered trace into an empty result. Keep the accumulated map and allow the remaining attempts to recover; only abort errors should terminate polling.
} catch (error) {
if (isAbortError(error)) throw error;
return [];
- Files reviewed: 19/21 changed files
- Comments generated: 1
- Review effort level: Balanced
Keep collected spans across transient failures and enforce a six-second deadline across requests, response bodies, and delays. Move frontend tests out of Python test discovery and format the regenerated bundle for the required hooks.


Motivation & Context
The Aspire integration currently forwards events and tool activity to DevUI, but it does not populate the Traces tab. Aspire-hosted .NET agent applications therefore cannot inspect their traces in DevUI even though the spans are available through the local Aspire Dashboard.
This change connects those spans to the corresponding DevUI response while preserving the existing proxy behavior.
Description & Review Guide
What are the major changes?
What is the impact of these changes?
What do you want reviewers to focus on?
Validation
dotnet format: 0 files changedgit diff --check: passedLive validation screenshots and sanitized evidence
Related Issue
Fixes #5806
Contribution Checklist