Skip to content
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

Span Id formatting in details title #960

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
<Panel2>
<div class="details-container">
<FluentHeader Style="height: auto;">
@DetailsTitle
@if (DetailsTitle is not null)
{
@DetailsTitle
}
else if (DetailsTitleTemplate is not null)
{
@DetailsTitleTemplate
}
<div class="header-right">
<FluentButton Appearance="Appearance.Stealth"
IconEnd="@(Orientation == Orientation.Horizontal ? _splitHorizontalIcon : _splitVerticalIcon)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public partial class SummaryDetailsView
[Parameter]
public bool ShowDetails { get; set; }

[Parameter, EditorRequired]
public required string DetailsTitle { get; set; }
[Parameter]
public string? DetailsTitle { get; set; }

[Parameter]
public Orientation Orientation { get; set; } = Orientation.Vertical;
Expand All @@ -42,6 +42,9 @@ public partial class SummaryDetailsView
[Parameter]
public string? ViewKey { get; set; }

[Parameter]
public RenderFragment? DetailsTitleTemplate { get; set; }

[Inject]
public required ProtectedLocalStorage ProtectedLocalStore { get; set; }

Expand Down
8 changes: 7 additions & 1 deletion src/Aspire.Dashboard/Components/Pages/TraceDetail.razor
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
<FluentAnchor slot="end" Appearance="Appearance.Lightweight" Href="@($"/Traces")">Back</FluentAnchor>
</FluentToolbar>

<SummaryDetailsView DetailsTitle="@(SelectedSpan?.Title)" ShowDetails="SelectedSpan is not null" OnDismiss="() => ClearSelectedSpan()" ViewKey="TraceDetail">
<SummaryDetailsView ShowDetails="SelectedSpan is not null" OnDismiss="() => ClearSelectedSpan()" ViewKey="TraceDetail">
<DetailsTitleTemplate>
<div>
@SelectedSpan!.Title
<span class="span-id">@OtlpHelpers.ToShortenedId(SelectedSpan!.Span.SpanId)</span>
</div>
</DetailsTitleTemplate>
<Summary>
<FluentDataGrid Class="trace-view-grid" ResizableColumns="true" ItemsProvider="@GetData" TGridItem="SpanWaterfallViewModel" RowClass="@GetRowClass" GridTemplateColumns="2fr 6fr">
<TemplateColumn Title="Name">
Expand Down
5 changes: 1 addition & 4 deletions src/Aspire.Dashboard/Components/Pages/TraceDetail.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ public partial class TraceDetail
[Parameter]
public string? SpanId { get; set; }

[Inject]
public required IDialogService DialogService { get; set; }

[Inject]
public required TelemetryRepository TelemetryRepository { get; set; }

Expand Down Expand Up @@ -158,7 +155,7 @@ private void OnShowProperties(SpanWaterfallViewModel viewModel)
{
Span = viewModel.Span,
Properties = entryProperties,
Title = $"{viewModel.Span.Source.ApplicationName}: {viewModel.GetDisplaySummary()} {OtlpHelpers.ToShortenedId(viewModel.Span.SpanId)}"
Title = $"{viewModel.Span.Source.ApplicationName}: {viewModel.GetDisplaySummary()}"
};

SelectedSpan = spanDetailsViewModel;
Expand Down
2 changes: 1 addition & 1 deletion src/Aspire.Dashboard/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fluent-dialog fluent-data-grid-cell[cell-type=columnheader] fluent-button[appear
}

.span-id {
color: rgb(136, 136, 136);
color: var(--foreground-subtext-rest);
padding-left: 0.5rem;
font-size: 12px;
}
Expand Down