Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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)
{
Expand All @@ -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<string, object?> data)
return;

data.TryAdd("Version", version);
}

/// <summary>
/// Runs through the formatting plugins to calculate a stack title based on an event.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ export interface EventErrorSummaryData {
Path?: string;
Type?: string;
TypeFullName?: string;
Version?: string;
}

export interface EventFeatureSummaryData {
Identity?: string;
IpAddress?: string[];
Name?: string;
Source?: string;
Version?: string;
}

export interface EventLogSummaryData {
Expand All @@ -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 {
Expand All @@ -41,13 +45,15 @@ export interface EventSessionSummaryData {
SessionId?: string;
Type?: 'heartbeat' | 'session' | 'sessionend';
Value?: string;
Version?: string;
}

export interface EventSimpleSummaryData {
Message?: string;
Path?: string;
Type?: string;
TypeFullName?: string;
Version?: string;
}

export interface EventSummaryData {
Expand All @@ -56,6 +62,7 @@ export interface EventSummaryData {
Name?: string;
Source?: string;
Type?: string;
Version?: string;
}

export interface EventSummaryModel<T extends SummaryTemplateKeys> extends SummaryModel<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const defaultEventColumnVisibility: ColumnVisibilityState = {
message: false,
name: false,
source: false,
type: false
type: false,
version: false
};

export function getColumns<TSummaryModel extends SummaryModel<SummaryTemplateKeys>>(
Expand Down Expand Up @@ -102,6 +103,16 @@ export function getColumns<TSummaryModel extends SummaryModel<SummaryTemplateKey
class: 'w-28'
}
},
{
accessorFn: (row) => 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()),
Expand Down
5 changes: 3 additions & 2 deletions tests/Exceptionless.Tests/Search/Data/event1.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"Identity": "My-User-Identity",
"Name": "test user",
"Source": "GET /Print",
"Level": "Error"
"Level": "Error",
"Version": "1.2.3.0"
}
}
}
5 changes: 3 additions & 2 deletions tests/Exceptionless.Tests/Search/Data/event2.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"Identity": "example@exceptionless.com",
"Type": "Exception",
"TypeFullName": "System.Exception",
"Path": "/user.aspx"
"Path": "/user.aspx",
"Version": "3.2.1-beta1"
}
}
}
5 changes: 3 additions & 2 deletions tests/Exceptionless.Tests/Search/Data/event3.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
5 changes: 3 additions & 2 deletions tests/Exceptionless.Tests/Search/Data/event4.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"data": {
"Message": "custom Event",
"Source": null,
"Type": "custom"
"Type": "custom",
"Version": "1.0.0.0"
}
}
}
5 changes: 3 additions & 2 deletions tests/Exceptionless.Tests/Search/Data/event5.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"template_key": "event-log-summary",
"data": {
"Message": "Row not found or changed.",
"Source": "TestController"
"Source": "TestController",
"Version": "1.2.2"
}
}
}
Loading