3 instantiations of OtlpLogEntry
Aspire.Dashboard (1)
Otlp\Storage\TelemetryRepository.cs (1)
358
var logEntry = new
OtlpLogEntry
(record, resourceView, scope, _otlpContext);
Aspire.Dashboard.Components.Tests (1)
Controls\StructuredLogDetailsTests.cs (1)
35
LogEntry = new
OtlpLogEntry
(
Aspire.Dashboard.Tests (1)
Model\SpanWaterfallViewModelTests.cs (1)
60
var log = new
OtlpLogEntry
(TelemetryTestHelpers.CreateLogRecord(traceId: trace.TraceId, spanId: "1"), app1View, scope, context);
159 references to OtlpLogEntry
Aspire.Dashboard (143)
Api\TelemetryApiService.cs (4)
234
Field = nameof(
OtlpLogEntry
.Severity),
242
var allLogs = new List<
OtlpLogEntry
>();
363
Field = nameof(
OtlpLogEntry
.Severity),
371
await foreach (
var
log in telemetryRepository.WatchLogsAsync(null, filters, cancellationToken).ConfigureAwait(false))
Components\Controls\PropertyValues\LogLevelValue.razor.cs (1)
18
public required
OtlpLogEntry
LogEntry { get; set; }
Components\Controls\StructuredLogActions.razor.cs (1)
26
public required
OtlpLogEntry
LogEntry { get; set; }
Components\Pages\StructuredLogs.razor.cs (10)
50
private FluentDataGrid<
OtlpLogEntry
>? _dataGrid;
132
private async ValueTask<GridItemsProviderResult<
OtlpLogEntry
>> GetData(GridItemsProviderRequest<
OtlpLogEntry
> request)
263
var
logEntryId = TelemetryRepository.GetLog(LogEntryId.Value);
310
private async Task OnShowPropertiesAsync(
OtlpLogEntry
entry, string? buttonId)
419
private string GetRowClass(
OtlpLogEntry
entry)
446
if (_dataGrid != null && FluentDataGridHelper<
OtlpLogEntry
>.TrySetMaxItemCount(_dataGrid, 10_000))
543
private bool IsGenAILogEntry(
OtlpLogEntry
logEntry)
559
private async Task LaunchGenAIVisualizerAsync(
OtlpLogEntry
logEntry)
607
foreach (
var
l in logs.Items.DistinctBy(l => (l.SpanId, l.TraceId)))
Components\Pages\TraceDetail.razor.cs (1)
513
private async Task ToggleSpanLogsAsync(
OtlpLogEntry
logEntry)
Components\ResourcesGridColumns\LogMessageColumnDisplay.razor.cs (4)
12
public required
OtlpLogEntry
LogEntry { get; set; }
18
public required EventCallback<
OtlpLogEntry
> LaunchGenAIVisualizerCallback { get; set; }
21
public required Func<
OtlpLogEntry
, bool> IsGenAILogCallback { get; set; }
27
_exceptionText =
OtlpLogEntry
.GetExceptionText(LogEntry);
Components_Pages_StructuredLogs_razor.g.cs (36)
1131
OtlpLogEntry
1137
__builder4.AddComponentParameter(117, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1154
__builder4.AddComponentParameter(118, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1171
__builder4.AddComponentParameter(119, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1188
__builder4.AddComponentParameter(120, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1205
__builder4.AddComponentParameter(121, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1222
__builder4.AddComponentParameter(122, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1230
), (global::System.Func<
OtlpLogEntry
, global::System.String>)(
1239
__builder4.AddComponentParameter(123, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1256
__builder4.AddComponentParameter(124, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1273
__builder4.AddComponentParameter(125, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1290
__builder4.AddComponentParameter(126, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1307
__builder4.AddComponentParameter(127, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1324
__builder4.AddComponentParameter(128, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1332
), (global::Microsoft.FluentUI.AspNetCore.Components.GridItemsProvider<
OtlpLogEntry
>)(
1341
__builder4.AddComponentParameter(129, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1358
__builder4.AddComponentParameter(130, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1375
__builder4.AddComponentParameter(131, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1383
), (global::System.Func<
OtlpLogEntry
, global::System.Object>)(
1392
__builder4.AddComponentParameter(132, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1400
), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow<
OtlpLogEntry
>>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow<
OtlpLogEntry
>>(this,
1409
__builder4.AddComponentParameter(133, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>.
1419
global::__Blazor.Aspire.Dashboard.Components.Pages.StructuredLogs.TypeInference.CreateAspireTemplateColumn_3(__builder5, 135, default(
OtlpLogEntry
)!, 136,
1483
global::__Blazor.Aspire.Dashboard.Components.Pages.StructuredLogs.TypeInference.CreateAspireTemplateColumn_4(__builder5, 147, default(
OtlpLogEntry
)!, 148,
1517
), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Otlp.Model.
OtlpLogEntry
>(
1530
global::__Blazor.Aspire.Dashboard.Components.Pages.StructuredLogs.TypeInference.CreateAspireTemplateColumn_5(__builder5, 155, default(
OtlpLogEntry
)!, 156,
1582
global::__Blazor.Aspire.Dashboard.Components.Pages.StructuredLogs.TypeInference.CreateAspireTemplateColumn_6(__builder5, 164, default(
OtlpLogEntry
)!, 165,
1633
), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Otlp.Model.
OtlpLogEntry
>(
1650
), (global::System.Func<global::Aspire.Dashboard.Otlp.Model.
OtlpLogEntry
, global::System.Boolean>)(
1667
), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::Aspire.Dashboard.Otlp.Model.
OtlpLogEntry
>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Aspire.Dashboard.Otlp.Model.
OtlpLogEntry
>(this,
1680
global::__Blazor.Aspire.Dashboard.Components.Pages.StructuredLogs.TypeInference.CreateAspireTemplateColumn_7(__builder5, 175, default(
OtlpLogEntry
)!, 176,
1774
global::__Blazor.Aspire.Dashboard.Components.Pages.StructuredLogs.TypeInference.CreateAspireTemplateColumn_8(__builder5, 188, default(
OtlpLogEntry
)!, 189,
1838
), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Otlp.Model.
OtlpLogEntry
>(
1900
= (global::Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid<
OtlpLogEntry
>)__value;
Components_ResourcesGridColumns_LogLevelColumnDisplay_razor.g.cs (1)
329
public required
OtlpLogEntry
LogEntry { get; set; }
Model\Assistant\AssistantChatDataContext.cs (3)
28
private readonly ConcurrentDictionary<long,
OtlpLogEntry
> _referencedLogs = new();
349
public void AddReferencedLogEntry(
OtlpLogEntry
logEntry)
354
public bool TryGetLog(long internalId, [NotNullWhen(true)] out
OtlpLogEntry
? logEntry)
Model\Assistant\Markdown\AspireEnrichmentParser.cs (1)
183
if (_options.DataContext.TryGetLog(result, out
var
logEntry))
Model\Assistant\Markdown\LogEntryInline.cs (1)
11
public required
OtlpLogEntry
LogEntry { get; init; }
Model\Assistant\Prompts\IceBreakersBuilder.cs (5)
136
public void StructuredLogs(BuildIceBreakersContext context, Func<PagedResult<
OtlpLogEntry
>> getCurrentLogs, bool hasErrors, Func<PagedResult<
OtlpLogEntry
>> getErrorLogs)
168
public void StructuredLogs(BuildIceBreakersContext context, OtlpResource resource, Func<PagedResult<
OtlpLogEntry
>> getCurrentLogs, bool hasErrors, Func<PagedResult<
OtlpLogEntry
>> getErrorLogs)
200
public void StructuredLogs(BuildIceBreakersContext context,
OtlpLogEntry
logEntry)
Model\Assistant\Prompts\KnownChatMessages.cs (4)
180
public static ChatMessage CreateErrorStructuredLogsMessage(List<
OtlpLogEntry
> errorLogs, DashboardOptions options, Func<IOtlpResource, string> getResourceName)
199
public static ChatMessage CreateAnalyzeLogEntryMessage(
OtlpLogEntry
logEntry, DashboardOptions options, Func<IOtlpResource, string> getResourceName)
287
public static ChatMessage CreateAnalyzeTraceMessage(OtlpTrace trace, List<
OtlpLogEntry
> traceLogEntries, IEnumerable<IOutgoingPeerResolver> outgoingPeerResolvers, DashboardOptions options, Func<IOtlpResource, string> getResourceName)
314
public static ChatMessage CreateAnalyzeSpanMessage(OtlpSpan span, List<
OtlpLogEntry
> traceLogEntries, IEnumerable<IOutgoingPeerResolver> outgoingPeerResolvers, DashboardOptions options, Func<IOtlpResource, string> getResourceName)
Model\Assistant\Prompts\PromptContextsBuilder.cs (5)
29
public static Task ErrorStructuredLogs(InitializePromptContext promptContext, string displayText, Func<PagedResult<
OtlpLogEntry
>> getErrorLogs)
34
foreach (
var
log in errorLogs.Items)
55
public static Task AnalyzeLogEntry(InitializePromptContext promptContext, string displayText,
OtlpLogEntry
logEntry)
75
foreach (
var
log in traceLogs)
95
foreach (
var
log in traceLogs)
Model\ExportHelpers.cs (1)
37
public static ExportResult GetLogEntryAsJson(
OtlpLogEntry
logEntry)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (2)
563
private static List<
OtlpLogEntry
> GetSpanLogEntries(TelemetryRepository telemetryRepository, OtlpSpan span)
589
foreach (
var
logEntry in logEntries)
Model\Otlp\SpanLogEntryViewModel.cs (1)
13
public required
OtlpLogEntry
LogEntry { get; init; }
Model\Otlp\SpanWaterfallViewModel.cs (3)
128
public static List<SpanWaterfallViewModel> Create(OtlpTrace trace, List<
OtlpLogEntry
> logs, TraceDetailState state)
147
static SpanWaterfallViewModel CreateViewModel(OtlpSpan span, int depth, bool hidden, TraceDetailState state, List<
OtlpLogEntry
>? spanLogs, ref int currentSpanLogIndex)
168
foreach (
var
log in spanLogs)
Model\Otlp\TelemetryFilter.cs (8)
18
public abstract IEnumerable<
OtlpLogEntry
> Apply(IEnumerable<
OtlpLogEntry
> input);
112
public override IEnumerable<
OtlpLogEntry
> Apply(IEnumerable<
OtlpLogEntry
> input)
116
case nameof(
OtlpLogEntry
.TimeStamp):
122
case nameof(
OtlpLogEntry
.Severity):
131
case nameof(
OtlpLogEntry
.Message):
139
return input.Where(x => func(
OtlpLogEntry
.GetFieldValue(x, Field) ?? string.Empty, Value));
Model\SpanType.cs (6)
89
public override IEnumerable<
OtlpLogEntry
> Apply(IEnumerable<
OtlpLogEntry
> input)
122
public override IEnumerable<
OtlpLogEntry
> Apply(IEnumerable<
OtlpLogEntry
> input)
155
public override IEnumerable<
OtlpLogEntry
> Apply(IEnumerable<
OtlpLogEntry
> input)
Model\StructuredLogMenuBuilder.cs (1)
63
OtlpLogEntry
logEntry,
Model\StructuredLogsViewModel.cs (7)
19
private PagedResult<
OtlpLogEntry
>? _logs;
109
public PagedResult<
OtlpLogEntry
> GetLogs()
135
filters.Add(new FieldTelemetryFilter { Field = nameof(
OtlpLogEntry
.Message), Condition = FilterCondition.Contains, Value = FilterText });
140
filters.Add(new FieldTelemetryFilter { Field = nameof(
OtlpLogEntry
.Severity), Condition = FilterCondition.GreaterThanOrEqual, Value = _logLevel.Value.ToString() });
149
public PagedResult<
OtlpLogEntry
> GetErrorLogs(int count)
152
filters.RemoveAll(f => f is FieldTelemetryFilter fieldFilter && fieldFilter.Field == nameof(
OtlpLogEntry
.Severity));
153
filters.Add(new FieldTelemetryFilter { Field = nameof(
OtlpLogEntry
.Severity), Condition = FilterCondition.GreaterThanOrEqual, Value = Microsoft.Extensions.Logging.LogLevel.Error.ToString() });
Model\StructureLogsDetailsViewModel.cs (2)
11
public required
OtlpLogEntry
LogEntry { get; init; }
13
public static string GetEventName(
OtlpLogEntry
logEntry, IStringLocalizer<Dashboard.Resources.StructuredLogs> loc)
Model\TelemetryExportService.cs (8)
233
internal static OtlpTelemetryDataJson ConvertLogsToOtlpJson(List<
OtlpLogEntry
> logs)
240
var
firstLog = resourceGroup.First();
260
private static OtlpLogRecordJson ConvertLogEntry(
OtlpLogEntry
log)
313
internal static string ConvertSpanToJson(OtlpSpan span, IOutgoingPeerResolver[] outgoingPeerResolvers, List<
OtlpLogEntry
>? logs = null, bool indent = true)
338
internal static string ConvertTraceToJson(OtlpTrace trace, IOutgoingPeerResolver[] outgoingPeerResolvers, List<
OtlpLogEntry
>? logs = null)
367
internal static string ConvertLogEntryToJson(
OtlpLogEntry
logEntry)
450
private static OtlpResourceLogsJson[]? ConvertLogsToResourceLogs(List<
OtlpLogEntry
>? logs)
462
var
firstLog = resourceGroup.First();
Otlp\Model\OtlpHelpers.cs (1)
492
public static string? GetEventName(
OtlpLogEntry
logEntry)
Otlp\Model\OtlpLogEntry.cs (3)
126
public static string? GetFieldValue(
OtlpLogEntry
log, string field)
146
public static string? GetExceptionText(
OtlpLogEntry
logEntry)
167
static string? GetProperty(
OtlpLogEntry
logEntry, string propertyName)
Otlp\Storage\TelemetryRepository.cs (12)
50
private readonly CircularBuffer<
OtlpLogEntry
> _logs;
340
List<
OtlpLogEntry
>? addedLogs = null;
358
var
logEntry = new OtlpLogEntry(record, resourceView, scope, _otlpContext);
396
addedLogs ??= new List<
OtlpLogEntry
>();
421
public PagedResult<
OtlpLogEntry
> GetLogs(GetLogsContext context)
430
return PagedResult<
OtlpLogEntry
>.Empty;
457
public
OtlpLogEntry
? GetLog(long logId)
463
foreach (
var
logEntry in _logs)
485
public List<
OtlpLogEntry
> GetLogsForSpan(string traceId, string spanId)
516
public List<
OtlpLogEntry
> GetLogsForTrace(string traceId)
940
foreach (
var
log in _logs)
942
var value =
OtlpLogEntry
.GetFieldValue(log, attributeName);
Otlp\Storage\TelemetryRepository.Watchers.cs (11)
130
public async IAsyncEnumerable<
OtlpLogEntry
> WatchLogsAsync(
136
var channel = Channel.CreateBounded<
OtlpLogEntry
>(new BoundedChannelOptions(1000)
167
foreach (
var
log in existingLogs.Items)
178
while (channel.Reader.TryRead(out
var
pendingLog))
189
await foreach (
var
log in channel.Reader.ReadAllAsync(cancellationToken).ConfigureAwait(false))
244
private void PushLogsToWatchers(List<
OtlpLogEntry
> logs, ResourceKey resourceKey)
262
foreach (
var
log in logs)
287
private static bool MatchesFilters(
OtlpLogEntry
log, List<TelemetryFilter> filters)
291
IEnumerable<
OtlpLogEntry
> result = [log];
341
private sealed class LogWatcher(ResourceKey? resourceKey, List<TelemetryFilter> filters, Channel<
OtlpLogEntry
> channel)
345
public Channel<
OtlpLogEntry
> Channel => channel;
Aspire.Dashboard.Tests (16)
Integration\OtlpHttpJsonTests.cs (2)
501
var
log = logs.Items.First();
578
var
log = logs.Items.First();
Model\SpanWaterfallViewModelTests.cs (1)
60
var
log = new OtlpLogEntry(TelemetryTestHelpers.CreateLogRecord(traceId: trace.TraceId, spanId: "1"), app1View, scope, context);
Model\TelemetryExportServiceTests.cs (1)
1079
var
logEntry = repository.GetLogs(GetLogsContext.ForResourceKey(repository.GetResources()[0].ResourceKey)).Items[0];
TelemetryRepositoryTests\LogTests.cs (3)
813
Filters = [new FieldTelemetryFilter { Condition = FilterCondition.Contains, Field = nameof(
OtlpLogEntry
.Message), Value = "does_not_contain" }]
821
Filters = [new FieldTelemetryFilter { Condition = FilterCondition.Contains, Field = nameof(
OtlpLogEntry
.Message), Value = "message" }]
1260
var
log = Assert.Single(logs.Items);
TelemetryRepositoryTests\TelemetryRepositoryTests.cs (9)
506
var receivedLogs = new List<
OtlpLogEntry
>();
512
await foreach (
var
log in repository.WatchLogsAsync(resourceKey: null, filters: null, cts.Token))
573
await foreach (
var
log in repository.WatchLogsAsync(resourceKey: null, filters: null, cts.Token))
669
Field = nameof(
OtlpLogEntry
.Message),
696
var receivedLogs = new List<
OtlpLogEntry
>();
702
await foreach (
var
log in repository.WatchLogsAsync(resourceKey: null, filters: filters, cts.Token))
760
Field = nameof(
OtlpLogEntry
.Severity),
787
var receivedLogs = new List<
OtlpLogEntry
>();
793
await foreach (
var
log in repository.WatchLogsAsync(resourceKey: null, filters: filters, cts.Token))