Skip to content

Fix dashboard telemetry filter races and replica searches - #19772

Draft
Sébastien Ros (sebastienros) wants to merge 3 commits into
mainfrom
sebros/review-pr-19661-issues
Draft

Fix dashboard telemetry filter races and replica searches#19772
Sébastien Ros (sebastienros) wants to merge 3 commits into
mainfrom
sebros/review-pr-19661-issues

Conversation

@sebastienros

@sebastienros Sébastien Ros (sebastienros) commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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-2 returned 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-eshtjezb replica alias retains the matching spans and their surrounding trace context.

Trace Detail filtered by a replica display name

trace-detail-replica-filter.webm

Validation

  • Added component tests with delayed repository reads to verify stale queries cannot publish matches or clear current selections.
  • Added repository coverage for source and peer replica aliases, including shortened GUID instance IDs.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
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
Copilot AI balanced review requested due to automatic review settings August 28, 2026 17:36
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19772

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19772"
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Comment thread src/Shared/Otlp/OtlpHelpers.cs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

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
Copilot AI review requested due to automatic review settings August 28, 2026 17:52
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings August 28, 2026 18:01
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

9 / 99 PR test projects · 3 PR jobs · 1 advisory-only target, from 9 changed files.

Selected PR test projects (9 / 99)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Testing.Tests, Aspire.Managed.Tests, Aspire.Playground.Tests

Selected PR jobs (3)

extension-e2e, polyglot, typescript-api-compat

Advisory workflow impact (1)

  • deployment-e2e (schedule/dispatch-only)

How these were chosen — grouped by what changed

🔧 src/Aspire.Dashboard/Components/Pages/StructuredLogs.razor.cs (changed source)
5 via the project graph: Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Managed.Tests (2 hops), Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Cli
1 test: Aspire.Cli.EndToEnd.Tests

🔧 src/Shared/Otlp/OtlpHelpers.cs (changed source)
1 via the project graph: Aspire.Cli.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/StructuredLogsTests.cs (changed test)
1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/TraceDetailsTests.cs (changed test)
1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Shared/TestTelemetryRepository.cs (changed test)
1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Tests/TelemetryRepositoryTests/TraceTests.cs (changed test)
1 directly: Aspire.Dashboard.Tests

Job reasons

Job Triggered by
deployment-e2e affected project Aspire.Cli
extension-e2e src/Aspire.Dashboard/Components/Pages/StructuredLogs.razor.cs, src/Aspire.Dashboard/Components/Pages/TraceDetail.razor.cs, src/Aspire.Dashboard/Otlp/Storage/SqliteTelemetryRepository.Resources.cs, src/Aspire.Dashboard/Otlp/Storage/SqliteTelemetryRepository.Traces.Reads.cs
• affected project Aspire.Dashboard
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 338cd74.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment on lines +532 to +534
var resourceIdsParameterName = $"SpanTextFragmentResourceIds{index}";
parameters.Add(resourceIdsParameterName, displayNameAliasResourceIds);
displayNamePredicate = $" OR r.resource_id IN @{resourceIdsParameterName} OR pr.resource_id IN @{resourceIdsParameterName}";
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@JamesNK

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants