1 implementation of IOtlpResource
aspire (1)
src\Shared\Otlp\IOtlpResource.cs (1)
28public sealed record SimpleOtlpResource(string ResourceName, string? InstanceId) : IOtlpResource;
38 references to IOtlpResource
aspire (31)
Commands\ExportCommand.cs (2)
259IReadOnlyList<IOtlpResource> allOtlpResources, 290IReadOnlyList<IOtlpResource> allOtlpResources,
Commands\TelemetryCommandHelpers.cs (5)
320/// Converts an array of <see cref="ResourceInfoJson"/> to a list of <see cref="IOtlpResource"/> for use with <see cref="OtlpHelpers.GetResourceName"/>. 322public static IReadOnlyList<IOtlpResource> ToOtlpResources(ResourceInfoJson[] resources) 324var result = new IOtlpResource[resources.Length]; 336public static void ResolveResourceColors(ResourceColorMap colorMap, IReadOnlyList<IOtlpResource> allResources) 345public static string ResolveResourceName(OtlpResourceJson? resource, IReadOnlyList<IOtlpResource> allResources)
Commands\TelemetryLogsCommand.cs (5)
168private async Task<int> GetLogsSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, CancellationToken cancellationToken) 194private async Task<int> StreamLogsAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, CancellationToken cancellationToken) 224private void DisplayLogsSnapshot(string json, IReadOnlyList<IOtlpResource> allResources) 238private void DisplayLogsStreamLine(string json, IReadOnlyList<IOtlpResource> allResources) 244private void DisplayResourceLogs(IEnumerable<OtlpResourceLogsJson> resourceLogs, IReadOnlyList<IOtlpResource> allResources)
Commands\TelemetrySpansCommand.cs (5)
169private async Task<int> GetSpansSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, CancellationToken cancellationToken) 195private async Task<int> StreamSpansAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, CancellationToken cancellationToken) 225private void DisplaySpansSnapshot(string json, IReadOnlyList<IOtlpResource> allResources) 239private void DisplaySpansStreamLine(string json, IReadOnlyList<IOtlpResource> allResources) 245private void DisplayResourceSpans(IEnumerable<OtlpResourceSpansJson> resourceSpans, IReadOnlyList<IOtlpResource> allResources)
Commands\TelemetryTracesCommand.cs (2)
239private void DisplayTracesTable(string json, IReadOnlyList<IOtlpResource> allResources) 312private void DisplayTraceDetails(string json, string traceId, IReadOnlyList<IOtlpResource> allResources)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (8)
60Func<IOtlpResource, string> getResourceName, 89Func<IOtlpResource, string> getResourceName, 109Func<IOtlpResource, string> getResourceName, 138Func<IOtlpResource, string> getResourceName, 209Func<IOtlpResource, string> getResourceName, 576Func<IOtlpResource, string> getResourceName, 760internal sealed record OtlpLogEntryDto(OtlpLogRecordJson LogRecord, IOtlpResource Resource, string? ScopeName); 775internal sealed record OtlpSpanDto(OtlpSpanJson Span, IOtlpResource Resource, string? ScopeName);
src\Shared\Otlp\IOtlpResource.cs (1)
24/// Simple implementation of <see cref="IOtlpResource"/> for cases where only the name and instance ID are needed.
src\Shared\Otlp\OtlpHelpers.cs (3)
89public static string GetResourceName(IOtlpResource resource, IReadOnlyList<IOtlpResource> allResources) 92foreach (var item in allResources)
Aspire.Cli.Tests (7)
Commands\TelemetryCommandTests.cs (7)
174IOtlpResource[] allResources, 188yield return [null, Array.Empty<IOtlpResource>(), "unknown"]; 190yield return [new OtlpResourceJson { Attributes = null }, new IOtlpResource[] { new SimpleOtlpResource("unknown", null) }, "unknown"]; 192yield return [MakeResource("frontend", "abc123"), new IOtlpResource[] { new SimpleOtlpResource("frontend", "abc123") }, "frontend"]; 194yield return [MakeResource("apiservice", null), new IOtlpResource[] { new SimpleOtlpResource("apiservice", null) }, "apiservice"]; 196yield return [MakeResource("frontend", "abc123"), new IOtlpResource[] { new SimpleOtlpResource("frontend", "abc123"), new SimpleOtlpResource("frontend", "xyz789") }, "frontend-abc123"]; 198yield return [MakeResource("worker", guidStr), new IOtlpResource[] { new SimpleOtlpResource("worker", guidStr), new SimpleOtlpResource("worker", Guid.NewGuid().ToString()) }, $"worker-{guid:N}"[..15]];