File: Otlp\Storage\GetTracesRequest.cs
Web Access
Project: src\src\Aspire.Dashboard\Aspire.Dashboard.csproj (Aspire.Dashboard)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using Aspire.Dashboard.Model.Otlp;
 
namespace Aspire.Dashboard.Otlp.Storage;
 
public sealed class GetTracesRequest
{
    public required IReadOnlyList<ResourceKey> ResourceKeys { get; init; }
    public required int StartIndex { get; init; }
    public required int Count { get; init; }
    public required List<TelemetryFilter> Filters { get; init; }
    public string? TraceNameFilterText { get; init; }
    public string[]? TextFragments { get; init; }
 
    /// <summary>
    /// Gets the maximum number of the latest matching traces available for paging.
    /// </summary>
    internal int? LatestItemCount { get; init; }
 
    public static GetTracesRequest ForResourceKey(ResourceKey resourceKey) => new()
    {
        ResourceKeys = [resourceKey],
        StartIndex = 0,
        Count = int.MaxValue,
        Filters = []
    };
}