Fix dashboard telemetry filter races and replica searches - #19772
Fix dashboard telemetry filter races and replica searches#19772Sébastien Ros (sebastienros) wants to merge 3 commits into
Conversation
Prevent stale filter queries from replacing current trace matches or clearing newer selections. Match replica display aliases in SQLite-backed span searches. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7cba34e1-430b-411b-8957-2170881b6a2b
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19772Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19772" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Fixes out-of-order dashboard telemetry filtering and enables span searches by displayed replica names.
Changes:
- Adds latest-wins guards for trace and structured-log filtering.
- Searches source and peer resource display-name aliases.
- Adds focused concurrency and repository tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/Aspire.Dashboard.Tests/TelemetryRepositoryTests/TraceTests.cs |
Tests replica alias searches. |
tests/Aspire.Dashboard.Components.Tests/Shared/TestTelemetryRepository.cs |
Adds injectable query handlers. |
tests/Aspire.Dashboard.Components.Tests/Pages/TraceDetailsTests.cs |
Tests stale trace-filter results. |
tests/Aspire.Dashboard.Components.Tests/Pages/StructuredLogsTests.cs |
Tests stale selection clearing. |
src/Shared/Otlp/OtlpHelpers.cs |
Extracts display-name formatting. |
src/Aspire.Dashboard/Otlp/Storage/SqliteTelemetryRepository.Traces.Reads.cs |
Matches aliases in span queries. |
src/Aspire.Dashboard/Otlp/Storage/SqliteTelemetryRepository.Resources.cs |
Resolves alias resource IDs. |
src/Aspire.Dashboard/Components/Pages/TraceDetail.razor.cs |
Prevents stale match publication. |
src/Aspire.Dashboard/Components/Pages/StructuredLogs.razor.cs |
Protects newer log selections. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Keep uninstrumented peers in the display-alias candidate set while deriving replica suffixes from instrumented resources. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7cba34e1-430b-411b-8957-2170881b6a2b
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 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.
tests/Aspire.Dashboard.Components.Tests/Pages/TraceDetailsTests.cs:1078
- This test releases the older request before the current one, so it never exercises the reported out-of-order completion or proves that a late stale result cannot replace already-published current matches. Complete the current request first, then release the older request and assert that the current match remains.
continueRestrictiveQuery.SetResult();
Assert.False(await olderRefresh);
Assert.NotNull(cut.Instance.PageViewModel.SelectedData);
continueCurrentQuery.SetResult();
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Tests selector9 / 99 PR test projects · 3 PR jobs · 1 advisory-only target, from 9 changed files. Selected PR test projects (9 / 99)
Selected PR jobs (3)
Advisory workflow impact (1)
How these were chosen — grouped by what changed🔧 📦 affected project 🔧 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
| var resourceIdsParameterName = $"SpanTextFragmentResourceIds{index}"; | ||
| parameters.Add(resourceIdsParameterName, displayNameAliasResourceIds); | ||
| displayNamePredicate = $" OR r.resource_id IN @{resourceIdsParameterName} OR pr.resource_id IN @{resourceIdsParameterName}"; |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
It's probably a good idea to cancel or at least ignore old queries. You can see some comments I added to source to tell agent to stop bringing this up because I had bigger things to worry about at the time. |
Description
Dashboard telemetry filter queries run asynchronously and can complete out of order. A stale query could replace current Trace Detail matches or clear a newer structured-log selection. SQLite span searches also matched only base resource names, so searching for a displayed replica name such as
service-replica-2returned no direct match.This change makes filter updates latest-wins and ties structured-log clearing to the entry that was originally evaluated. Span text queries now reuse the dashboard's resource display-name formatting and add exact source or peer resource IDs for alias-only matches, including shortened GUID instance IDs.
User-facing usage
Rapid filter changes no longer leave Trace Detail showing stale results or unexpectedly close a newer selection. Trace Detail searches also match the replica names displayed in source and peer labels.
Screenshots / Recordings
Filtering Trace Detail by the full
catalogservice-eshtjezbreplica alias retains the matching spans and their surrounding trace context.trace-detail-replica-filter.webm
Validation
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?