Repository navigation
Add timestamp search qualifier for telemetry filtering - #17816
Conversation
Add a timestamp search qualifier for filtering traces, spans, and logs by date/time. The filter supports comparison operators (>, >=, <, <=, ==, !=) with ISO 8601 date values. - Add TimestampField constants to KnownTraceFields and KnownStructuredLogFields - Add GetFieldValue support returning UTC ticks for timestamp fields - Add TryMatchDate for date-based comparison in TelemetryFilter - Introduce FieldType enum (String, Numeric, Date) for cleaner IsMatch dispatch - Add FluentTextField with native datetime-local picker in FilterDialog - Add date validation in FilterDialogFormModel - Timestamps without timezone are treated as local time, with offset are adjusted to UTC, with Z are treated as UTC - Add comprehensive tests for timestamp filtering behavior
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17816Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17816" |
There was a problem hiding this comment.
Pull request overview
Adds a timestamp search qualifier to Aspire Dashboard telemetry filtering so users can filter spans/logs (and related UI filters) using ISO 8601 date/time comparisons, including local-time inputs and UTC/offset handling.
Changes:
- Adds
timestampas a known field for traces/spans and structured logs, and wires the qualifier throughTelemetryApiService. - Extends filtering to support date comparisons (date-aware field typing + ticks-based comparisons).
- Updates the filter dialog UI and localized resources to support date/time entry via a
datetime-localpicker, plus adds unit tests.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Dashboard.Tests/TelemetryApiServiceTests.cs | Adds tests covering timestamp qualifier behavior (>, <, >=, invalid date, Z/offset/local parsing). |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.zh-Hant.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.zh-Hans.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.tr.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.ru.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.pt-BR.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.pl.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.ko.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.ja.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.it.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.fr.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.es.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.de.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/xlf/Dialogs.cs.xlf | Adds new localization entries for date/time filter UI strings. |
| src/Aspire.Dashboard/Resources/Dialogs.resx | Adds new resource strings used by the date/time filter dialog UI. |
| src/Aspire.Dashboard/Resources/Dialogs.Designer.cs | Regenerates strongly-typed resource accessors for the new dialog strings. |
| src/Aspire.Dashboard/Otlp/Storage/TelemetryRepository.cs | Excludes date fields from the optimized string filter path. |
| src/Aspire.Dashboard/Otlp/Model/OtlpSpan.cs | Exposes span start timestamp as ticks for timestamp filtering. |
| src/Aspire.Dashboard/Otlp/Model/OtlpLogEntry.cs | Exposes log timestamp as ticks for timestamp filtering. |
| src/Aspire.Dashboard/Model/Otlp/TelemetryFilter.cs | Adds date-aware field typing and date matching logic to filtering. |
| src/Aspire.Dashboard/Model/Otlp/KnownTraceFields.cs | Adds trace.timestamp known field and includes it in the field list. |
| src/Aspire.Dashboard/Model/Otlp/KnownStructuredLogFields.cs | Adds log.timestamp known field and includes it in the field list. |
| src/Aspire.Dashboard/Model/Otlp/FilterDialogFormModel.cs | Adds date value handling/validation for filter dialog inputs. |
| src/Aspire.Dashboard/Components/Dialogs/FilterDialog.razor.js | Adds JS interop helper to open the native date/time picker. |
| src/Aspire.Dashboard/Components/Dialogs/FilterDialog.razor.cs | Adds date-specific filter conditions and JS interop to open the picker. |
| src/Aspire.Dashboard/Components/Dialogs/FilterDialog.razor | Adds date/time input UI with calendar icon + hidden datetime-local input. |
| src/Aspire.Dashboard/Api/TelemetryApiService.cs | Wires the timestamp qualifier to known trace/log timestamp fields. |
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/Dialogs.Designer.cs: Language not supported
- Implement IAsyncDisposable on FilterDialog to dispose _jsModule - Change timestamp field values from ticks to milliseconds to avoid precision loss when compared as doubles (max ~3.16e14 vs 2^53)
|
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 Tests unknown — 110 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26794946230 |
Adam Ratzman (adamint)
left a comment
There was a problem hiding this comment.
reviewed with gpt-5.5 and opus 4.8/4.7/4.6. No high-severity issues from me, so approving.
A few non-blocking things I think are worth considering:
- Typed timestamp search doesn't seem to support equality operators even though the date filter surface exposes
==/!=.SearchTextParseronly treats>/>=/</<=as operators, sotimestamp:==2024-...becomes a contains filter with value==2024-..., and date matching rejects contains. Either parsing==/!=or not advertising those operators for typed timestamp searches would avoid a confusing no-results case. - No-offset timestamp values are parsed with
AssumeLocal, which means the dashboard server's timezone. The dashboard UI displays times in the browser timezone, anddatetime-localvalues come from the browser, so container/server timezone != browser timezone can shift the filter window. GetSpans_WithTimestampDateOnly_FiltersCorrectlyassumes the date-only cutoff won't cross the first span. In far-positive UTC offsets,1970-01-02local midnight can convert to1970-01-01T10:00Z, which would include the Jan 1 noon span too.
None of these are blocking under the high-severity-only policy.
|
Tested this locally:
I tried to do the dashboard Playwright smoke check too, but couldn't get a dashboard app running for a reason that looks unrelated to this PR: the generated starter app fails to compile with |
Mitch Denny (mitchdenny)
left a comment
There was a problem hiding this comment.
LGTM. Verified locally: build clean; all 35 timestamp-related tests and all 39 TelemetryApiServiceTests pass. Nice handling of the timezone edge cases (Z suffix, explicit offset, no-TZ as local, date-only) and good use of FieldType to replace the isNumeric bool.
Documents the new 'timestamp' search qualifier added in microsoft/aspire#17816. Users can now filter traces and structured logs by date/time using ISO 8601 strings with comparison operators (>, >=, <, <=) in the dashboard filter bar. Co-authored-by: Copilot <[email protected]>
|
Pull request created: #1181
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1181 targeting Updated Note This draft PR needs human review before merging. |
…1181) * docs: document timestamp search qualifier for telemetry filtering Documents the new 'timestamp' search qualifier added in microsoft/aspire#17816. Users can now filter traces and structured logs by date/time using ISO 8601 strings with comparison operators (>, >=, <, <=) in the dashboard filter bar. Co-authored-by: Copilot <[email protected]> * Move timestamp qualifier docs to shared CLI references Co-authored-by: JamesNK <[email protected]> * Fix severity casing in timestamp search example Co-authored-by: JamesNK <[email protected]> * Apply suggestions from code review Co-authored-by: James Newton-King <[email protected]> * Apply suggestion from @JamesNK * Apply suggestion from @JamesNK * docs: clarify date-only timestamp search values Co-authored-by: JamesNK <[email protected]> * Apply suggestion from @JamesNK * Apply suggestion from @JamesNK * Update timestamp example dates to use 2026 --------- Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: JamesNK <[email protected]> Co-authored-by: James Newton-King <[email protected]>
Description
Add a
timestampsearch qualifier for filtering traces, spans, and structured logs by date/time in the dashboard. Users can filter telemetry using comparison operators with ISO 8601 date strings (e.g.,timestamp:>2024-01-15T09:30:00,timestamp:<=2024-06-01T12:00:00Z).UI
User-facing usage
In the search/filter bar on the Traces, Spans, or Logs pages:
Timestamps without a timezone suffix are treated as local time, timestamps with an offset are adjusted to UTC, and timestamps with
Zare treated as UTC directly.When using the filter dialog UI, selecting the Timestamp field shows a text input for the ISO date value with a calendar icon that opens the browser's native date/time picker.
Implementation details
TimestampFieldconstants toKnownTraceFieldsandKnownStructuredLogFieldsFieldTypeenum (String,Numeric,Date) replacing the booleanisNumericparameter in filter matchingTryMatchDatefor ticks-based date comparison inTelemetryFilterFluentTextFieldwith a calendar icon that triggers the nativedatetime-localpicker via JS interopChecklist