Skip to content

Commit 00836cf

Browse files
authored
Merge pull request #101 from datalust/dev
2021.3.0 Release
2 parents 0d84cf3 + 88447b3 commit 00836cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+655
-173
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ while(true)
6464
foreach (var evt in resultSet.Events)
6565
Console.WriteLine(evt.RenderedMessage);
6666

67-
if (resultSet.Statistics.Status != ResultSetStatus.Partial)
67+
if (resultSet.Statistics.Status == ResultSetStatus.Complete)
6868
break;
6969

7070
lastReadEventId = resultSet.Statistics.LastReadEventId;

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ artifacts:
99
deploy:
1010
- provider: NuGet
1111
api_key:
12-
secure: sMicBLl7Z83H/mhX10DL7Yqwa80ZHUbb9fRHKmxd5m2MN2DWAE1kbYH/GPQPFajZ
12+
secure: 29fNPaMVCbTVioV8D4/8PbTWEU3xwAuN4iFxqDcI8T60kfNzE4YvrvCPdXO9gl2q
1313
skip_symbols: true
1414
on:
1515
branch: /^(main|dev)$/
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System;
2+
using System.Collections.Generic;
3+
// ReSharper disable UnusedAutoPropertyAccessor.Global
4+
5+
namespace Seq.Api.Model.Alerting
6+
{
7+
/// <summary>
8+
/// A summary of recent activity on an alert.
9+
/// </summary>
10+
11+
public class AlertActivityPart
12+
{
13+
/// <summary>
14+
/// When the last check for the alert was performed.
15+
/// </summary>
16+
public DateTime? LastCheck { get; set; }
17+
18+
/// <summary>
19+
/// Whether or not the last check triggered any notifications.
20+
/// </summary>
21+
public bool LastCheckTriggered { get; set; }
22+
23+
/// <summary>
24+
/// Any failures that prevented the last check from completing successfully.
25+
/// These failures indicate a problem with the alert itself, not with the
26+
/// data being monitored.
27+
///
28+
/// A value of <c>null</c> indicates the last check succeeded.
29+
/// </summary>
30+
public List<string> LastCheckFailures { get; set; }
31+
32+
/// <summary>
33+
/// When the alert may be checked again after being triggered.
34+
/// </summary>
35+
public DateTime? SuppressedUntil { get; set; }
36+
37+
/// <summary>
38+
/// The most recent occurrences of the alert that triggered notifications.
39+
/// </summary>
40+
public List<AlertOccurrencePart> RecentOccurrences { get; set; } = new List<AlertOccurrencePart>();
41+
42+
/// <summary>
43+
/// The number of times this alert has been triggered since its creation.
44+
/// </summary>
45+
public int TotalOccurrences { get; set; }
46+
}
47+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Copyright Datalust and contributors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System;
16+
using System.Collections.Generic;
17+
using Seq.Api.Model.LogEvents;
18+
using Seq.Api.Model.Security;
19+
using Seq.Api.Model.Shared;
20+
using Seq.Api.Model.Signals;
21+
22+
namespace Seq.Api.Model.Alerting
23+
{
24+
/// <summary>
25+
/// An alert.
26+
/// </summary>
27+
public class AlertEntity : Entity
28+
{
29+
/// <summary>
30+
/// A friendly, human-readable title for the alert.
31+
/// </summary>
32+
public string Title { get; set; }
33+
34+
/// <summary>
35+
/// An optional long-form description of the alert.
36+
/// </summary>
37+
public string Description { get; set; }
38+
39+
/// <summary>
40+
/// The user id of the user who owns the alert; if <c>null</c>, the alert is shared.
41+
/// </summary>
42+
public string OwnerId { get; set; }
43+
44+
/// <summary>
45+
/// If <c>true</c>, the alert can only be modified by users with the <see cref="Permission.Setup"/> permission.
46+
/// </summary>
47+
public bool IsProtected { get; set; }
48+
49+
/// <summary>
50+
/// If <c>true</c>, the alert will not be processed, and notifications will not be sent.
51+
/// </summary>
52+
public bool IsDisabled { get; set; }
53+
54+
/// <summary>
55+
/// An optional <see cref="SignalExpressionPart"/> limiting the data source that triggers the alert.
56+
/// </summary>
57+
public SignalExpressionPart SignalExpression { get; set; }
58+
59+
/// <summary>
60+
/// An optional <c>where</c> clause limiting the data source that triggers the alert.
61+
/// </summary>
62+
public string Where { get; set; }
63+
64+
/// <summary>
65+
/// Additional groupings applied to the data source. The <c>time()</c> grouping is controlled by the alerting
66+
/// infrastructure according to the <see cref="TimeGrouping"/> property and should not be specified here.
67+
/// </summary>
68+
public List<GroupingColumnPart> GroupBy { get; set; } = new List<GroupingColumnPart>();
69+
70+
/// <summary>
71+
/// The interval over which the alert condition will be measured.
72+
/// </summary>
73+
public TimeSpan TimeGrouping { get; set; }
74+
75+
/// <summary>
76+
/// The individual measurements that will be tested by the alert condition.
77+
/// </summary>
78+
public List<ColumnPart> Select { get; set; } = new List<ColumnPart>();
79+
80+
/// <summary>
81+
/// The alert condition. This is a <c>having</c> clause over the grouped results
82+
/// computed by the alert query.
83+
/// </summary>
84+
public string Having { get; set; }
85+
86+
/// <summary>
87+
/// A level indicating the severity or priority of the alert.
88+
/// </summary>
89+
public LogEventLevel NotificationLevel { get; set; }
90+
91+
/// <summary>
92+
/// Additional properties that will be attached to the generated notification.
93+
/// </summary>
94+
public List<EventPropertyPart> NotificationProperties { get; set; } = new List<EventPropertyPart>();
95+
96+
/// <summary>
97+
/// The channels that will receive notifications when the alert is triggered.
98+
/// </summary>
99+
public List<NotificationChannelPart> NotificationChannels { get; set; } = new List<NotificationChannelPart>();
100+
101+
/// <summary>
102+
/// The time after the alert is triggered within which no further notifications will be sent.
103+
/// </summary>
104+
public TimeSpan SuppressionTime { get; set; }
105+
106+
/// <summary>
107+
/// Any recent activity for the alert.
108+
/// </summary>
109+
public AlertActivityPart Activity { get; set; }
110+
}
111+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Seq.Api.Model.AppInstances;
2+
3+
namespace Seq.Api.Model.Alerting
4+
{
5+
/// <summary>
6+
/// A record of the <see cref="NotificationChannelPart"/> that was notified of an alert occurrence.
7+
/// </summary>
8+
public class AlertNotificationPart
9+
{
10+
/// <summary>
11+
/// The <see cref="AppInstanceEntity" /> that was notified.
12+
/// This id is a historical record, so it may be for app instance that no longer exists.
13+
/// </summary>
14+
public string HistoricalAppInstanceId { get; set; }
15+
}
16+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Seq.Api.Model.AppInstances;
4+
using Seq.Api.Model.LogEvents;
5+
using Seq.Api.Model.Shared;
6+
7+
namespace Seq.Api.Model.Alerting
8+
{
9+
/// <summary>
10+
/// An occurrence of an alert that triggered notifications.
11+
/// </summary>
12+
public class AlertOccurrencePart
13+
{
14+
/// <summary>
15+
/// The time when the alert was checked and triggered.
16+
/// </summary>
17+
public DateTime DetectedAt { get; set; }
18+
19+
/// <summary>
20+
/// The time grouping that triggered the alert.
21+
/// </summary>
22+
public DateTimeRange DetectedOverRange { get; set; }
23+
24+
/// <summary>
25+
/// The level of notifications sent for this instance.
26+
/// </summary>
27+
public LogEventLevel NotificationLevel { get; set; }
28+
29+
/// <summary>
30+
/// The <see cref="NotificationChannelPart">NotificationChannelParts</see> that were alerted.
31+
/// </summary>
32+
public List<AlertNotificationPart> Notifications { get; set; } = new List<AlertNotificationPart>();
33+
}
34+
}

src/Seq.Api/Model/Monitoring/AlertStateEntity.cs renamed to src/Seq.Api/Model/Alerting/AlertStateEntity.cs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
// limitations under the License.
1414

1515
using System;
16+
using System.Collections.Generic;
1617

17-
namespace Seq.Api.Model.Monitoring
18+
namespace Seq.Api.Model.Alerting
1819
{
1920
/// <summary>
2021
/// Describes the state of an active alert.
@@ -31,30 +32,15 @@ public class AlertStateEntity : Entity
3132
/// </summary>
3233
public string Title { get; set; }
3334

34-
/// <summary>
35-
/// The title of the chart to which the alert is attached.
36-
/// </summary>
37-
public string ChartTitle { get; set; }
38-
39-
/// <summary>
40-
/// The title of the dashboards in which the alert is set.
41-
/// </summary>
42-
public string DashboardTitle { get; set; }
43-
4435
/// <summary>
4536
/// The user id of the user who owns the alert; if <c>null</c>, the alert is shared.
4637
/// </summary>
4738
public string OwnerId { get; set; }
4839

4940
/// <summary>
50-
/// The notification level associated with the alert.
51-
/// </summary>
52-
public string Level { get; set; }
53-
54-
/// <summary>
55-
/// The id of an app instance that will receive notifications when the alert is triggered.
41+
/// The ids of app instances that receive notifications when the alert is triggered.
5642
/// </summary>
57-
public string NotificationAppInstanceId { get; set; }
43+
public List<string> NotificationAppInstanceIds { get; set; }
5844

5945
/// <summary>
6046
/// The time at which the alert was last checked. Not preserved across server restarts.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright Datalust and contributors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System.Collections.Generic;
16+
using Seq.Api.Model.AppInstances;
17+
18+
namespace Seq.Api.Model.Alerting
19+
{
20+
/// <summary>
21+
/// A notification channel belonging to an alert.
22+
/// </summary>
23+
public class NotificationChannelPart
24+
{
25+
/// <summary>
26+
/// A system-assigned identifier for the channel. This is used when updating channels to carry over unchanged
27+
/// values of sensitive settings, which are not round-tripped to the client for editing. When creating a
28+
/// new channel, this should be <c>null</c>.
29+
/// </summary>
30+
public string Id { get; set; }
31+
32+
/// <summary>
33+
/// The message used for the title or subject of the notification. If not specified, a default message based
34+
/// on the alert title will be used.
35+
/// </summary>
36+
public string NotificationMessage { get; set; }
37+
38+
/// <summary>
39+
/// If <c>true</c>, notifications will include a sample of the events that contributed to the triggering of
40+
/// the alert.
41+
/// </summary>
42+
public bool IncludeContributingEvents { get; set; }
43+
44+
/// <summary>
45+
/// When <see cref="IncludeContributingEvents"/> is <c>true</c>, the maximum number of contributing events to
46+
/// include in the notification. Note that this value is an upper limit, and server resource constraints may
47+
/// prevent all contributing events from being included even below this limit.
48+
/// </summary>
49+
public uint? IncludedContributingEventLimit { get; set; }
50+
51+
/// <summary>
52+
/// The id of an <see cref="AppInstanceEntity"/> that will receive notifications from the alert.
53+
/// </summary>
54+
public string NotificationAppInstanceId { get; set; }
55+
56+
/// <summary>
57+
/// Additional properties that will be used to configure the notification app when triggered
58+
/// by the alert.
59+
/// </summary>
60+
public Dictionary<string, string> NotificationAppSettingOverrides { get; set; } =
61+
new Dictionary<string, string>();
62+
}
63+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright Datalust and contributors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
namespace Seq.Api.Model.Cluster
16+
{
17+
/// <summary>
18+
/// Describes a node in a Seq cluster.
19+
/// </summary>
20+
public class ClusterNodeEntity : Entity
21+
{
22+
/// <summary>
23+
/// The role the node is currently acting in.
24+
/// </summary>
25+
public NodeRole Role { get; set; }
26+
27+
/// <summary>
28+
/// An informational name associated with the node.
29+
/// </summary>
30+
public string Name { get; set; }
31+
32+
/// <summary>
33+
/// An informational representation of the storage generation committed to the node.
34+
/// </summary>
35+
public string Generation { get; set; }
36+
37+
/// <summary>
38+
/// Whether any writes have occurred since the node's last completed sync.
39+
/// </summary>
40+
public bool? IsUpToDate { get; set; }
41+
42+
/// <summary>
43+
/// The time since the node's last completed sync operation.
44+
/// </summary>
45+
public double? MillisecondsSinceLastSync { get; set; }
46+
47+
/// <summary>
48+
/// An informational description of the node's current state, or <c langword="null">null</c> if no additional
49+
/// information about the node is available.
50+
/// </summary>
51+
public string StateDescription { get; set; }
52+
}
53+
}

0 commit comments

Comments
 (0)