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 |
|
Addressed the latest review feedback in
The existing Aspire screenshots are still representative. This revision changes the empty-state guidance for non-Aspire .NET servers and adds cancellation coverage. It does not change the Aspire trace layout or the successful trace display. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 18 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
dotnet/src/Aspire.Hosting.AgentFramework.DevUI/SseResponseIdCapture.cs:63
- The 64 KiB cap can discard valid response IDs. This repository's
StreamingResponseCreatedserializes a fullResponse, including request instructions and tool definitions (Microsoft.Agents.AI.Hosting.OpenAI/Responses/AgentResponseUpdateExtensions.cs:242-272), so a validdata:line can exceed this limit. Once that happens, this parser drops the entire line; the later lifecycle response events can carry the same large response payload, leavingResponseIdnull and preventing any trace mapping. Keep memory bounded while extractingresponse.idwithout requiring the complete line to fit in 64 KiB, and add coverage with an oversizedresponse.createdevent.
if (this._lineBuffer.WrittenCount >= MaxLineLength)
{
this._lineBuffer.Clear();
this._discardingOversizedLine = true;
continue;
|
Fixed the oversized SSE case in |
|
Please make sure to use the regular PR template Saibernard |
|
Updated the PR description to use the repository standard template. Thanks for the reminder, Eduard van Valkenburg (@eavanvalkenburg). |


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