From c51faa942a41d01020b0b91d3aac7808d3bc1850 Mon Sep 17 00:00:00 2001 From: "Eric J. Smith" Date: Mon, 22 Jun 2026 13:59:35 -0500 Subject: [PATCH] Add event version column --- .../Plugins/Formatting/FormattingPluginManager.cs | 15 ++++++++++++++- .../features/events/components/summary/index.ts | 7 +++++++ .../events/components/table/options.svelte.ts | 13 ++++++++++++- .../Search/Data/event1.summary.json | 5 +++-- .../Search/Data/event2.summary.json | 5 +++-- .../Search/Data/event3.summary.json | 5 +++-- .../Search/Data/event4.summary.json | 5 +++-- .../Search/Data/event5.summary.json | 5 +++-- 8 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/Exceptionless.Core/Plugins/Formatting/FormattingPluginManager.cs b/src/Exceptionless.Core/Plugins/Formatting/FormattingPluginManager.cs index 26f2fa6fa1..fed7458780 100644 --- a/src/Exceptionless.Core/Plugins/Formatting/FormattingPluginManager.cs +++ b/src/Exceptionless.Core/Plugins/Formatting/FormattingPluginManager.cs @@ -1,4 +1,5 @@ -using Exceptionless.Core.Models; +using Exceptionless.Core.Extensions; +using Exceptionless.Core.Models; using Microsoft.Extensions.Logging; namespace Exceptionless.Core.Plugins.Formatting; @@ -44,7 +45,10 @@ public SummaryData GetEventSummaryData(PersistentEvent ev) { var result = plugin.GetEventSummaryData(ev); if (result is not null) + { + AddVersionSummaryData(result, ev); return result; + } } catch (Exception ex) { @@ -55,6 +59,15 @@ public SummaryData GetEventSummaryData(PersistentEvent ev) throw new InvalidOperationException(); } + private static void AddVersionSummaryData(SummaryData summary, PersistentEvent ev) + { + string? version = ev.GetVersion(); + if (String.IsNullOrWhiteSpace(version) || summary.Data is not IDictionary data) + return; + + data.TryAdd("Version", version); + } + /// /// Runs through the formatting plugins to calculate a stack title based on an event. /// diff --git a/src/Exceptionless.Web/ClientApp/src/lib/features/events/components/summary/index.ts b/src/Exceptionless.Web/ClientApp/src/lib/features/events/components/summary/index.ts index e9c0a88fd2..ea2992c294 100644 --- a/src/Exceptionless.Web/ClientApp/src/lib/features/events/components/summary/index.ts +++ b/src/Exceptionless.Web/ClientApp/src/lib/features/events/components/summary/index.ts @@ -10,6 +10,7 @@ export interface EventErrorSummaryData { Path?: string; Type?: string; TypeFullName?: string; + Version?: string; } export interface EventFeatureSummaryData { @@ -17,6 +18,7 @@ export interface EventFeatureSummaryData { IpAddress?: string[]; Name?: string; Source?: string; + Version?: string; } export interface EventLogSummaryData { @@ -26,12 +28,14 @@ export interface EventLogSummaryData { Name?: string; Source?: string; SourceShortName?: string; + Version?: string; } export interface EventNotFoundSummaryData { Identity?: string; Name?: string; Source?: string; + Version?: string; } export interface EventSessionSummaryData { @@ -41,6 +45,7 @@ export interface EventSessionSummaryData { SessionId?: string; Type?: 'heartbeat' | 'session' | 'sessionend'; Value?: string; + Version?: string; } export interface EventSimpleSummaryData { @@ -48,6 +53,7 @@ export interface EventSimpleSummaryData { Path?: string; Type?: string; TypeFullName?: string; + Version?: string; } export interface EventSummaryData { @@ -56,6 +62,7 @@ export interface EventSummaryData { Name?: string; Source?: string; Type?: string; + Version?: string; } export interface EventSummaryModel extends SummaryModel { diff --git a/src/Exceptionless.Web/ClientApp/src/lib/features/events/components/table/options.svelte.ts b/src/Exceptionless.Web/ClientApp/src/lib/features/events/components/table/options.svelte.ts index 657e40b287..d37fec0582 100644 --- a/src/Exceptionless.Web/ClientApp/src/lib/features/events/components/table/options.svelte.ts +++ b/src/Exceptionless.Web/ClientApp/src/lib/features/events/components/table/options.svelte.ts @@ -21,7 +21,8 @@ export const defaultEventColumnVisibility: ColumnVisibilityState = { message: false, name: false, source: false, - type: false + type: false, + version: false }; export function getColumns>( @@ -102,6 +103,16 @@ export function getColumns getSummaryDataValue(row, 'Version'), + cell: (prop) => formatTextColumn(prop.getValue()), + enableSorting: false, + header: 'Version', + id: 'version', + meta: { + class: 'w-32' + } + }, { accessorFn: (row) => getSummaryDataValue(row, 'Type'), cell: (prop) => formatTextColumn(prop.getValue()), diff --git a/tests/Exceptionless.Tests/Search/Data/event1.summary.json b/tests/Exceptionless.Tests/Search/Data/event1.summary.json index c42a61814e..b1a8558954 100644 --- a/tests/Exceptionless.Tests/Search/Data/event1.summary.json +++ b/tests/Exceptionless.Tests/Search/Data/event1.summary.json @@ -7,6 +7,7 @@ "Identity": "My-User-Identity", "Name": "test user", "Source": "GET /Print", - "Level": "Error" + "Level": "Error", + "Version": "1.2.3.0" } -} \ No newline at end of file +} diff --git a/tests/Exceptionless.Tests/Search/Data/event2.summary.json b/tests/Exceptionless.Tests/Search/Data/event2.summary.json index 4b8470a42f..814465b6d1 100644 --- a/tests/Exceptionless.Tests/Search/Data/event2.summary.json +++ b/tests/Exceptionless.Tests/Search/Data/event2.summary.json @@ -7,6 +7,7 @@ "Identity": "example@exceptionless.com", "Type": "Exception", "TypeFullName": "System.Exception", - "Path": "/user.aspx" + "Path": "/user.aspx", + "Version": "3.2.1-beta1" } -} \ No newline at end of file +} diff --git a/tests/Exceptionless.Tests/Search/Data/event3.summary.json b/tests/Exceptionless.Tests/Search/Data/event3.summary.json index c67917e4e8..925940853e 100644 --- a/tests/Exceptionless.Tests/Search/Data/event3.summary.json +++ b/tests/Exceptionless.Tests/Search/Data/event3.summary.json @@ -9,6 +9,7 @@ "Type": "NullReferenceException", "TypeFullName": "System.NullReferenceException", "Method": "AssociateWithCurrentThread", - "MethodFullName": "System.Web.ThreadContext.AssociateWithCurrentThread" + "MethodFullName": "System.Web.ThreadContext.AssociateWithCurrentThread", + "Version": "4.0.1039 6f929bbe18" } -} \ No newline at end of file +} diff --git a/tests/Exceptionless.Tests/Search/Data/event4.summary.json b/tests/Exceptionless.Tests/Search/Data/event4.summary.json index e65e267288..6c057aad5f 100644 --- a/tests/Exceptionless.Tests/Search/Data/event4.summary.json +++ b/tests/Exceptionless.Tests/Search/Data/event4.summary.json @@ -5,6 +5,7 @@ "data": { "Message": "custom Event", "Source": null, - "Type": "custom" + "Type": "custom", + "Version": "1.0.0.0" } -} \ No newline at end of file +} diff --git a/tests/Exceptionless.Tests/Search/Data/event5.summary.json b/tests/Exceptionless.Tests/Search/Data/event5.summary.json index bced8a7b14..7ece30ae90 100644 --- a/tests/Exceptionless.Tests/Search/Data/event5.summary.json +++ b/tests/Exceptionless.Tests/Search/Data/event5.summary.json @@ -4,6 +4,7 @@ "template_key": "event-log-summary", "data": { "Message": "Row not found or changed.", - "Source": "TestController" + "Source": "TestController", + "Version": "1.2.2" } -} \ No newline at end of file +}