1 implementation of IOtlpResource
aspire (1)
src\Shared\Otlp\IOtlpResource.cs (1)
28
public sealed record SimpleOtlpResource(string ResourceName, string? InstanceId) :
IOtlpResource
;
38 references to IOtlpResource
aspire (31)
Commands\ExportCommand.cs (2)
259
IReadOnlyList<
IOtlpResource
> allOtlpResources,
290
IReadOnlyList<
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"/>.
322
public static IReadOnlyList<
IOtlpResource
> ToOtlpResources(ResourceInfoJson[] resources)
324
var result = new
IOtlpResource
[resources.Length];
336
public static void ResolveResourceColors(ResourceColorMap colorMap, IReadOnlyList<
IOtlpResource
> allResources)
345
public static string ResolveResourceName(OtlpResourceJson? resource, IReadOnlyList<
IOtlpResource
> allResources)
Commands\TelemetryLogsCommand.cs (5)
168
private async Task<int> GetLogsSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<
IOtlpResource
> allResources, CancellationToken cancellationToken)
194
private async Task<int> StreamLogsAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<
IOtlpResource
> allResources, CancellationToken cancellationToken)
224
private void DisplayLogsSnapshot(string json, IReadOnlyList<
IOtlpResource
> allResources)
238
private void DisplayLogsStreamLine(string json, IReadOnlyList<
IOtlpResource
> allResources)
244
private void DisplayResourceLogs(IEnumerable<OtlpResourceLogsJson> resourceLogs, IReadOnlyList<
IOtlpResource
> allResources)
Commands\TelemetrySpansCommand.cs (5)
169
private async Task<int> GetSpansSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<
IOtlpResource
> allResources, CancellationToken cancellationToken)
195
private async Task<int> StreamSpansAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<
IOtlpResource
> allResources, CancellationToken cancellationToken)
225
private void DisplaySpansSnapshot(string json, IReadOnlyList<
IOtlpResource
> allResources)
239
private void DisplaySpansStreamLine(string json, IReadOnlyList<
IOtlpResource
> allResources)
245
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)
174
IOtlpResource
[] allResources,
188
yield return [null, Array.Empty<
IOtlpResource
>(), "unknown"];
190
yield return [new OtlpResourceJson { Attributes = null }, new
IOtlpResource
[] { new SimpleOtlpResource("unknown", null) }, "unknown"];
192
yield return [MakeResource("frontend", "abc123"), new
IOtlpResource
[] { new SimpleOtlpResource("frontend", "abc123") }, "frontend"];
194
yield return [MakeResource("apiservice", null), new
IOtlpResource
[] { new SimpleOtlpResource("apiservice", null) }, "apiservice"];
196
yield return [MakeResource("frontend", "abc123"), new
IOtlpResource
[] { new SimpleOtlpResource("frontend", "abc123"), new SimpleOtlpResource("frontend", "xyz789") }, "frontend-abc123"];
198
yield return [MakeResource("worker", guidStr), new
IOtlpResource
[] { new SimpleOtlpResource("worker", guidStr), new SimpleOtlpResource("worker", Guid.NewGuid().ToString()) }, $"worker-{guid:N}"[..15]];