1 implementation of IOtlpResource
aspire (1)
src\Shared\Otlp\IOtlpResource.cs (1)
28public sealed record SimpleOtlpResource(string ResourceName, string? InstanceId) : IOtlpResource;
36 references to IOtlpResource
aspire (29)
Commands\TelemetryCommandHelpers.cs (5)
321/// Converts an array of <see cref="ResourceInfoJson"/> to a list of <see cref="IOtlpResource"/> for use with <see cref="OtlpHelpers.GetResourceName"/>. 323public static IReadOnlyList<IOtlpResource> ToOtlpResources(ResourceInfoJson[] resources) 325var result = new IOtlpResource[resources.Length]; 337public static void ResolveResourceColors(ResourceColorMap colorMap, IReadOnlyList<IOtlpResource> allResources) 346public static string ResolveResourceName(OtlpResourceJson? resource, IReadOnlyList<IOtlpResource> allResources)
Commands\TelemetryLogsCommand.cs (5)
169private async Task<int> GetLogsSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, CancellationToken cancellationToken) 195private async Task<int> StreamLogsAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, CancellationToken cancellationToken) 225private void DisplayLogsSnapshot(string json, IReadOnlyList<IOtlpResource> allResources) 239private void DisplayLogsStreamLine(string json, IReadOnlyList<IOtlpResource> allResources) 245private void DisplayResourceLogs(IEnumerable<OtlpResourceLogsJson> resourceLogs, IReadOnlyList<IOtlpResource> allResources)
Commands\TelemetrySpansCommand.cs (5)
170private async Task<int> GetSpansSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, CancellationToken cancellationToken) 196private async Task<int> StreamSpansAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, CancellationToken cancellationToken) 226private void DisplaySpansSnapshot(string json, IReadOnlyList<IOtlpResource> allResources) 240private void DisplaySpansStreamLine(string json, IReadOnlyList<IOtlpResource> allResources) 246private 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)
175IOtlpResource[] allResources, 189yield return [null, Array.Empty<IOtlpResource>(), "unknown"]; 191yield return [new OtlpResourceJson { Attributes = null }, new IOtlpResource[] { new SimpleOtlpResource("unknown", null) }, "unknown"]; 193yield return [MakeResource("frontend", "abc123"), new IOtlpResource[] { new SimpleOtlpResource("frontend", "abc123") }, "frontend"]; 195yield return [MakeResource("apiservice", null), new IOtlpResource[] { new SimpleOtlpResource("apiservice", null) }, "apiservice"]; 197yield return [MakeResource("frontend", "abc123"), new IOtlpResource[] { new SimpleOtlpResource("frontend", "abc123"), new SimpleOtlpResource("frontend", "xyz789") }, "frontend-abc123"]; 199yield return [MakeResource("worker", guidStr), new IOtlpResource[] { new SimpleOtlpResource("worker", guidStr), new SimpleOtlpResource("worker", Guid.NewGuid().ToString()) }, $"worker-{guid:N}"[..15]];