Skip to content

Add links between telemetry and resources in grid values #10648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Jul 24, 2025

Description

  • Add support for registering custom components to display property grid values
  • Add custom components for linking to traces, spans and resources
  • Icons added to various status icons
image image

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?

@Copilot Copilot AI review requested due to automatic review settings July 24, 2025 08:19
Copy link
Contributor

@Copilot 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 adds support for custom components in property grids to display interactive links between telemetry data and resources. The implementation introduces a component metadata system that allows property grid values to be rendered as clickable links that navigate between traces, spans, and resources.

Key changes:

  • Introduction of a component metadata system for custom property grid value rendering
  • New custom components for displaying TraceId, SpanId, and ResourceName values as navigational links
  • Integration of custom components into SpanDetails and StructuredLogDetails views

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Aspire.Dashboard/Model/ComponentMetadata.cs New model for storing component type and parameters metadata
src/Aspire.Dashboard/Components/Controls/PropertyGrid.razor.cs Added support for ValueComponents parameter and component metadata lookup
src/Aspire.Dashboard/Components/Controls/GridValue.razor Added dynamic component rendering when ComponentMetadata is present
src/Aspire.Dashboard/Components/Controls/PropertyValues/TraceIdValue.razor New component for rendering trace IDs as navigational links
src/Aspire.Dashboard/Components/Controls/PropertyValues/SpanIdValue.razor.cs New component for rendering span IDs with availability checking
src/Aspire.Dashboard/Components/Controls/PropertyValues/ResourceNameValue.razor New component for rendering resource names as links
src/Aspire.Dashboard/Components/Controls/SpanDetails.razor.cs Integration of custom components for trace/span/resource navigation
src/Aspire.Dashboard/Components/Controls/StructuredLogDetails.razor.cs Integration of custom components for log entry navigation
src/Aspire.Dashboard/Components/Pages/TraceDetail.razor Added CloseCallback parameters to detail components
src/Aspire.Dashboard/Model/MetricsHelpers.cs Fixed dialog service call to run on UI dispatcher

@davidfowl
Copy link
Member

Video? Image?

@adamint
Copy link
Member

adamint commented Jul 24, 2025

Why did you decide to use DynamicComponent here? It feels like a more idiomatic solution would be changing GridValue.ValueTemplate to accept TItem, adding a parameter ValueTemplate to PropertyGrid, and supplying a value for that in StructuredLogDetails/TraceDetail like

<ValueTemplate Context="gridValue">
    @if (gridValue.Key is "key")
    {
        <SomeComponent OnClick="@(c => ....)" />
    }
</ValueTemplate>

@JamesNK
Copy link
Member Author

JamesNK commented Jul 25, 2025

I wanted to avoid the duplication of having if/else in each ValueTemplate. And having to pass Value and HighlightText properties to each control. And having a fallback control if there wasn't a match.

Also, it's an experiment to see how well this approach works.

@JamesNK JamesNK force-pushed the jamesnk/propertygrid-navigation branch from 39d5378 to dd98c70 Compare July 25, 2025 07:46
@JamesNK JamesNK force-pushed the jamesnk/propertygrid-navigation branch from 72189e0 to caa2c51 Compare July 26, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants