microsoft / microsoft/aspire

[Dashboard] Apply telemetry API limits in SQLite queries

Open
#19,773 1 comment 0 reactions 0 assignees View on GitHub
area-dashboard triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

The Dashboard telemetry API's spans, traces, and logs endpoints request `Count = int.MaxValue`, materialize every matching retained item, and only then apply the requested response limit.

A request for a small response can therefore still perform the full retained-data query and allocate the complete result.

### Expected Behavior

The requested response limit should bound repository paging and materialization. Total counts can be obtained separately when needed.

### Steps To Reproduce

1. Populate the Dashboard with retained logs or traces.
2. Request the corresponding telemetry API endpoint with a small `limit`.
3. Observe that the repository request still uses `Count = int.MaxValue` and the limit is applied after materialization.

### Exceptions (if any)

N/A

### Aspire doctor output

```plain
Aspire CLI 13.6.0-pr.18924.g5ee63941
Windows 10.0.26200
```

### Anything else?

Related to #18924. Source: `src/Aspire.Dashboard/Api/TelemetryApiService.cs:38-63,91-121,176-224`. This was acknowledged during PR review and remains on current `main`.

Contributor guide

Open the contributing guide

Research direction

Start in src/Aspire.Dashboard/Api/TelemetryApiService.cs at lines 38-63, 91-121, and 176-224, and trace how the spans, traces, and logs endpoints request repository data. Verify that the requested limit is used for paging and materialization rather than int.MaxValue, while total counts are handled separately when needed. Done means small-limit requests no longer load all retained telemetry items.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sqlite
Domain
api, databases, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.