Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented May 14, 2025

Description

Minor improvements and clean up

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
  • Does the change require an update in our Aspire docs?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces minor dashboard improvements and cleanup across multiple areas including localization updates, telemetry/logging enhancements, and code refactoring for subscription management and HTTP client creation.

  • Updated XLF resource files to remove extraneous click instructions and add new tooltips for resource states.
  • Refactored TelemetryRepository and Subscription to simplify processing and manage callback execution via a throttler.
  • Changed log entry internal identifier generation from a Guid to an Interlocked-incremented long and improved related utility functions.

Reviewed Changes

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

Show a summary per file
File Description
src/Aspire.Dashboard/Resources/xlf/Columns.*.xlf Updated translation sources, targets, and added new trans-units for resource waiting/not started states.
src/Aspire.Dashboard/Resources/Columns.resx Removed click instructions from tooltips and added new values for resource state messages.
src/Aspire.Dashboard/Otlp/Storage/TelemetryRepository.cs Refactored log trace lookup logic by replacing try-catch with a simple loop over traces.
src/Aspire.Dashboard/Otlp/Storage/Subscription.cs Removed internal locking/queueing and replaced it with a CallbackThrottler to manage execution.
src/Aspire.Dashboard/Otlp/Model/OtlpLogEntry.cs Changed InternalId from a Guid to a long using an atomic counter.
src/Aspire.Dashboard/Otlp/Model/OtlpHelpers.cs Defined a constant for shortened IDs and updated matching logic accordingly.
src/Aspire.Dashboard/Model/ResourceViewModel.cs Simplified resource name lookup and iteration over all resources.
src/Aspire.Dashboard/Model/ResourceStateViewModel.cs Updated resource state tooltip logic to include waiting and not started scenarios.
src/Aspire.Dashboard/Model/DebugSessionHelpers.cs Adjusted HTTP client creation to better handle null parameters and update header settings.
src/Aspire.Dashboard/Extensions/ResourceViewModelExtensions.cs Introduced a new IsWaiting() extension method for resource state.
src/Aspire.Dashboard/DashboardEndpointsBuilder.cs Changed culture lookup to use ordered cultures for consistent language selection.
src/Aspire.Dashboard/Components/ResourcesGridColumns/LogMessageColumnDisplay.razor.cs Replaced inline exception text resolution with a shared helper call.
src/Aspire.Dashboard/Components/Dialogs/SettingsDialog.razor.cs Simplified language options assignment and culture matching logic.
Files not reviewed (1)
  • src/Aspire.Dashboard/Resources/Columns.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)

src/Aspire.Dashboard/Otlp/Model/OtlpLogEntry.cs:30

  • Switching the InternalId from a Guid to a long via Interlocked.Increment changes the uniqueness guarantees; please confirm that this change meets the system's requirements for unique identifiers.
InternalId = Interlocked.Increment(ref s_nextLogEntryId);

public void Dispose()
{
_cts.Cancel();
_cts.Dispose();
Copy link
Member

Choose a reason for hiding this comment

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

:(

public OtlpLogEntry(LogRecord record, OtlpApplicationView logApp, OtlpScope scope, OtlpContext context)
{
InternalId = Guid.NewGuid();
InternalId = Interlocked.Increment(ref s_nextLogEntryId);
Copy link
Member

Choose a reason for hiding this comment

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

Why tho? More efficient

@JamesNK JamesNK merged commit bb5fb93 into main May 14, 2025
176 checks passed
@JamesNK JamesNK deleted the jamesnk/post93cleanup branch May 14, 2025 08:02
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants