diff --git a/llm-server/monitoring/src/Ghostnet.Dashboard/Components/Pages/Logs.razor b/llm-server/monitoring/src/Ghostnet.Dashboard/Components/Pages/Logs.razor index 289860c..b14d24b 100644 --- a/llm-server/monitoring/src/Ghostnet.Dashboard/Components/Pages/Logs.razor +++ b/llm-server/monitoring/src/Ghostnet.Dashboard/Components/Pages/Logs.razor @@ -25,7 +25,7 @@ value="@_search" @onchange="OnSearchChanged" /> - +
@@ -89,10 +89,27 @@ _live = !_live; } + /// + /// Manual refresh must never throw into the circuit: the discarded + /// task in the onclick handler killed the circuit on errors (found + /// 04.11.2026). + /// + private async Task OnManualRefreshAsync() + { + try + { + await RefreshAsync(_cts?.Token ?? default); + await InvokeAsync(StateHasChanged); + } + catch (Exception ex) when (ex is not OperationCanceledException) + { + _error = $"{ex.GetType().Name}: {ex.Message}"; + await InvokeAsync(StateHasChanged); + } + } + private async Task RunLoopAsync(CancellationToken ct) { - // Der erste Lauf laedt Filter und Eintraege; danach fragt der - // Live-Tail alle 3 Sekunden ab. try { await RefreshAsync(ct); @@ -106,7 +123,14 @@ } if (_live) { - await RefreshAsync(ct); + try + { + await RefreshAsync(ct); + } + catch (Exception ex) when (ex is not OperationCanceledException) + { + _error = $"{ex.GetType().Name}: {ex.Message}"; + } await InvokeAsync(StateHasChanged); } } diff --git a/llm-server/monitoring/src/Ghostnet.Dashboard/Services/LokiClient.cs b/llm-server/monitoring/src/Ghostnet.Dashboard/Services/LokiClient.cs index 5aa7ace..8626822 100644 --- a/llm-server/monitoring/src/Ghostnet.Dashboard/Services/LokiClient.cs +++ b/llm-server/monitoring/src/Ghostnet.Dashboard/Services/LokiClient.cs @@ -71,7 +71,9 @@ public sealed class LokiClient } /// - /// Returns the known values of a label (e.g. "unit") for filters. + /// Returns the known values of a label (e.g. "syslog_identifier") + /// for filters. The label values endpoint answers with the array + /// directly under "data" (not nested in an object). /// public async Task> GetLabelValuesAsync( string label, CancellationToken ct) @@ -86,10 +88,12 @@ public sealed class LokiClient { return values; } - foreach (var value in doc.RootElement - .GetProperty("data") - .GetProperty("values") - .EnumerateArray()) + var data = doc.RootElement.GetProperty("data"); + if (data.ValueKind != JsonValueKind.Array) + { + return values; + } + foreach (var value in data.EnumerateArray()) { values.Add(value.GetString() ?? ""); }