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 |


Summary
Fixes #5806.
This makes Aspire traces available in the existing DevUI Traces tab. The aggregator now:
I also fixed three issues in the Aspire sample that prevented the current sample from starting cleanly: conflicting dashboard ports, AppHost target-framework discovery, and an Aspire Azure package-version mismatch.
Testing
git diff --checkpassedI tested streaming and non-streaming responses against a real Azure GPT-4.1 deployment. Both responses mapped to the correct four-span Aspire trace. I also verified that cancelling a response does not leave a stale trace mapping.
The live Azure deployment had capacity for one request, so the two-request live concurrency check was rate-limited. The regression suite covers 12 simultaneous responses and trace lookups, plus 100 parallel SSE response-ID captures.