Port: Simplify TelemetryApiService.GetTrace and support short trace IDs#15641
Port: Simplify TelemetryApiService.GetTrace and support short trace IDs#15641
Conversation
…t trace IDs (#15613) * Simplify TelemetryApiService.GetTrace and support short trace IDs - Use TelemetryRepository.GetTrace instead of fetching all traces - Add early return in GetTraceUnsynchronized for IDs shorter than ShortenedIdLength - Add parameterized unit test for full, short, and nonexistent trace IDs * Use hex constant in GetTrace test for explicit trace ID relationship * Remove early return for short trace IDs in GetTraceUnsynchronized MatchTelemetryId already handles short IDs correctly with exact equality fallback, so the guard was preventing valid exact-match lookups. * Clean up
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15641Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15641" |
There was a problem hiding this comment.
Pull request overview
Ports the release/13.2 fix to main to make trace lookup more efficient and to support shortened (prefix) trace ID queries through the dashboard telemetry API.
Changes:
- Simplifies
TelemetryApiService.GetTraceby delegating toTelemetryRepository.GetTrace(which supports short-ID matching). - Adds a parameterized unit test covering full trace ID, shortened prefix, too-short ID, and nonexistent ID scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Aspire.Dashboard/Api/TelemetryApiService.cs | Switches GetTrace to use repository direct lookup instead of fetching/paging all traces. |
| tests/Aspire.Dashboard.Tests/TelemetryApiServiceTests.cs | Adds a [Theory] validating behavior for full/short/invalid trace IDs. |
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
|
🎬 CLI E2E Test Recordings — 52 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23630247449 |
Description
Port of #15613 from release/13.2 to main.
Simplify
TelemetryApiService.GetTraceand support short trace IDs:TelemetryRepository.GetTraceinstead of fetching all tracesChecklist