1 implementation of IOtlpResource
aspire (1)
src\Shared\Otlp\IOtlpResource.cs (1)
28
public 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"/>.
323
public static IReadOnlyList<
IOtlpResource
> ToOtlpResources(ResourceInfoJson[] resources)
325
var result = new
IOtlpResource
[resources.Length];
337
public static void ResolveResourceColors(ResourceColorMap colorMap, IReadOnlyList<
IOtlpResource
> allResources)
346
public static string ResolveResourceName(OtlpResourceJson? resource, IReadOnlyList<
IOtlpResource
> allResources)
Commands\TelemetryLogsCommand.cs (5)
169
private async Task<int> GetLogsSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<
IOtlpResource
> allResources, CancellationToken cancellationToken)
195
private async Task<int> StreamLogsAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<
IOtlpResource
> allResources, CancellationToken cancellationToken)
225
private void DisplayLogsSnapshot(string json, IReadOnlyList<
IOtlpResource
> allResources)
239
private void DisplayLogsStreamLine(string json, IReadOnlyList<
IOtlpResource
> allResources)
245
private void DisplayResourceLogs(IEnumerable<OtlpResourceLogsJson> resourceLogs, IReadOnlyList<
IOtlpResource
> allResources)
Commands\TelemetrySpansCommand.cs (5)
170
private async Task<int> GetSpansSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<
IOtlpResource
> allResources, CancellationToken cancellationToken)
196
private async Task<int> StreamSpansAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<
IOtlpResource
> allResources, CancellationToken cancellationToken)
226
private void DisplaySpansSnapshot(string json, IReadOnlyList<
IOtlpResource
> allResources)
240
private void DisplaySpansStreamLine(string json, IReadOnlyList<
IOtlpResource
> allResources)
246
private void DisplayResourceSpans(IEnumerable<OtlpResourceSpansJson> resourceSpans, IReadOnlyList<
IOtlpResource
> allResources)
Commands\TelemetryTracesCommand.cs (2)
239
private void DisplayTracesTable(string json, IReadOnlyList<
IOtlpResource
> allResources)
312
private void DisplayTraceDetails(string json, string traceId, IReadOnlyList<
IOtlpResource
> allResources)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (8)
60
Func<
IOtlpResource
, string> getResourceName,
89
Func<
IOtlpResource
, string> getResourceName,
109
Func<
IOtlpResource
, string> getResourceName,
138
Func<
IOtlpResource
, string> getResourceName,
209
Func<
IOtlpResource
, string> getResourceName,
576
Func<
IOtlpResource
, string> getResourceName,
760
internal sealed record OtlpLogEntryDto(OtlpLogRecordJson LogRecord,
IOtlpResource
Resource, string? ScopeName);
775
internal 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)
89
public static string GetResourceName(
IOtlpResource
resource, IReadOnlyList<
IOtlpResource
> allResources)
92
foreach (
var
item in allResources)
Aspire.Cli.Tests (7)
Commands\TelemetryCommandTests.cs (7)
175
IOtlpResource
[] allResources,
189
yield return [null, Array.Empty<
IOtlpResource
>(), "unknown"];
191
yield return [new OtlpResourceJson { Attributes = null }, new
IOtlpResource
[] { new SimpleOtlpResource("unknown", null) }, "unknown"];
193
yield return [MakeResource("frontend", "abc123"), new
IOtlpResource
[] { new SimpleOtlpResource("frontend", "abc123") }, "frontend"];
195
yield return [MakeResource("apiservice", null), new
IOtlpResource
[] { new SimpleOtlpResource("apiservice", null) }, "apiservice"];
197
yield return [MakeResource("frontend", "abc123"), new
IOtlpResource
[] { new SimpleOtlpResource("frontend", "abc123"), new SimpleOtlpResource("frontend", "xyz789") }, "frontend-abc123"];
199
yield return [MakeResource("worker", guidStr), new
IOtlpResource
[] { new SimpleOtlpResource("worker", guidStr), new SimpleOtlpResource("worker", Guid.NewGuid().ToString()) }, $"worker-{guid:N}"[..15]];