-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from datalust/dev
2021.3.0 Release
- Loading branch information
Showing
57 changed files
with
655 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
// ReSharper disable UnusedAutoPropertyAccessor.Global | ||
|
||
namespace Seq.Api.Model.Alerting | ||
{ | ||
/// <summary> | ||
/// A summary of recent activity on an alert. | ||
/// </summary> | ||
|
||
public class AlertActivityPart | ||
{ | ||
/// <summary> | ||
/// When the last check for the alert was performed. | ||
/// </summary> | ||
public DateTime? LastCheck { get; set; } | ||
|
||
/// <summary> | ||
/// Whether or not the last check triggered any notifications. | ||
/// </summary> | ||
public bool LastCheckTriggered { get; set; } | ||
|
||
/// <summary> | ||
/// Any failures that prevented the last check from completing successfully. | ||
/// These failures indicate a problem with the alert itself, not with the | ||
/// data being monitored. | ||
/// | ||
/// A value of <c>null</c> indicates the last check succeeded. | ||
/// </summary> | ||
public List<string> LastCheckFailures { get; set; } | ||
|
||
/// <summary> | ||
/// When the alert may be checked again after being triggered. | ||
/// </summary> | ||
public DateTime? SuppressedUntil { get; set; } | ||
|
||
/// <summary> | ||
/// The most recent occurrences of the alert that triggered notifications. | ||
/// </summary> | ||
public List<AlertOccurrencePart> RecentOccurrences { get; set; } = new List<AlertOccurrencePart>(); | ||
|
||
/// <summary> | ||
/// The number of times this alert has been triggered since its creation. | ||
/// </summary> | ||
public int TotalOccurrences { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
// Copyright Datalust and contributors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Seq.Api.Model.LogEvents; | ||
using Seq.Api.Model.Security; | ||
using Seq.Api.Model.Shared; | ||
using Seq.Api.Model.Signals; | ||
|
||
namespace Seq.Api.Model.Alerting | ||
{ | ||
/// <summary> | ||
/// An alert. | ||
/// </summary> | ||
public class AlertEntity : Entity | ||
{ | ||
/// <summary> | ||
/// A friendly, human-readable title for the alert. | ||
/// </summary> | ||
public string Title { get; set; } | ||
|
||
/// <summary> | ||
/// An optional long-form description of the alert. | ||
/// </summary> | ||
public string Description { get; set; } | ||
|
||
/// <summary> | ||
/// The user id of the user who owns the alert; if <c>null</c>, the alert is shared. | ||
/// </summary> | ||
public string OwnerId { get; set; } | ||
|
||
/// <summary> | ||
/// If <c>true</c>, the alert can only be modified by users with the <see cref="Permission.Setup"/> permission. | ||
/// </summary> | ||
public bool IsProtected { get; set; } | ||
|
||
/// <summary> | ||
/// If <c>true</c>, the alert will not be processed, and notifications will not be sent. | ||
/// </summary> | ||
public bool IsDisabled { get; set; } | ||
|
||
/// <summary> | ||
/// An optional <see cref="SignalExpressionPart"/> limiting the data source that triggers the alert. | ||
/// </summary> | ||
public SignalExpressionPart SignalExpression { get; set; } | ||
|
||
/// <summary> | ||
/// An optional <c>where</c> clause limiting the data source that triggers the alert. | ||
/// </summary> | ||
public string Where { get; set; } | ||
|
||
/// <summary> | ||
/// Additional groupings applied to the data source. The <c>time()</c> grouping is controlled by the alerting | ||
/// infrastructure according to the <see cref="TimeGrouping"/> property and should not be specified here. | ||
/// </summary> | ||
public List<GroupingColumnPart> GroupBy { get; set; } = new List<GroupingColumnPart>(); | ||
|
||
/// <summary> | ||
/// The interval over which the alert condition will be measured. | ||
/// </summary> | ||
public TimeSpan TimeGrouping { get; set; } | ||
|
||
/// <summary> | ||
/// The individual measurements that will be tested by the alert condition. | ||
/// </summary> | ||
public List<ColumnPart> Select { get; set; } = new List<ColumnPart>(); | ||
|
||
/// <summary> | ||
/// The alert condition. This is a <c>having</c> clause over the grouped results | ||
/// computed by the alert query. | ||
/// </summary> | ||
public string Having { get; set; } | ||
|
||
/// <summary> | ||
/// A level indicating the severity or priority of the alert. | ||
/// </summary> | ||
public LogEventLevel NotificationLevel { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that will be attached to the generated notification. | ||
/// </summary> | ||
public List<EventPropertyPart> NotificationProperties { get; set; } = new List<EventPropertyPart>(); | ||
|
||
/// <summary> | ||
/// The channels that will receive notifications when the alert is triggered. | ||
/// </summary> | ||
public List<NotificationChannelPart> NotificationChannels { get; set; } = new List<NotificationChannelPart>(); | ||
|
||
/// <summary> | ||
/// The time after the alert is triggered within which no further notifications will be sent. | ||
/// </summary> | ||
public TimeSpan SuppressionTime { get; set; } | ||
|
||
/// <summary> | ||
/// Any recent activity for the alert. | ||
/// </summary> | ||
public AlertActivityPart Activity { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Seq.Api.Model.AppInstances; | ||
|
||
namespace Seq.Api.Model.Alerting | ||
{ | ||
/// <summary> | ||
/// A record of the <see cref="NotificationChannelPart"/> that was notified of an alert occurrence. | ||
/// </summary> | ||
public class AlertNotificationPart | ||
{ | ||
/// <summary> | ||
/// The <see cref="AppInstanceEntity" /> that was notified. | ||
/// This id is a historical record, so it may be for app instance that no longer exists. | ||
/// </summary> | ||
public string HistoricalAppInstanceId { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Seq.Api.Model.AppInstances; | ||
using Seq.Api.Model.LogEvents; | ||
using Seq.Api.Model.Shared; | ||
|
||
namespace Seq.Api.Model.Alerting | ||
{ | ||
/// <summary> | ||
/// An occurrence of an alert that triggered notifications. | ||
/// </summary> | ||
public class AlertOccurrencePart | ||
{ | ||
/// <summary> | ||
/// The time when the alert was checked and triggered. | ||
/// </summary> | ||
public DateTime DetectedAt { get; set; } | ||
|
||
/// <summary> | ||
/// The time grouping that triggered the alert. | ||
/// </summary> | ||
public DateTimeRange DetectedOverRange { get; set; } | ||
|
||
/// <summary> | ||
/// The level of notifications sent for this instance. | ||
/// </summary> | ||
public LogEventLevel NotificationLevel { get; set; } | ||
|
||
/// <summary> | ||
/// The <see cref="NotificationChannelPart">NotificationChannelParts</see> that were alerted. | ||
/// </summary> | ||
public List<AlertNotificationPart> Notifications { get; set; } = new List<AlertNotificationPart>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright Datalust and contributors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System.Collections.Generic; | ||
using Seq.Api.Model.AppInstances; | ||
|
||
namespace Seq.Api.Model.Alerting | ||
{ | ||
/// <summary> | ||
/// A notification channel belonging to an alert. | ||
/// </summary> | ||
public class NotificationChannelPart | ||
{ | ||
/// <summary> | ||
/// A system-assigned identifier for the channel. This is used when updating channels to carry over unchanged | ||
/// values of sensitive settings, which are not round-tripped to the client for editing. When creating a | ||
/// new channel, this should be <c>null</c>. | ||
/// </summary> | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// The message used for the title or subject of the notification. If not specified, a default message based | ||
/// on the alert title will be used. | ||
/// </summary> | ||
public string NotificationMessage { get; set; } | ||
|
||
/// <summary> | ||
/// If <c>true</c>, notifications will include a sample of the events that contributed to the triggering of | ||
/// the alert. | ||
/// </summary> | ||
public bool IncludeContributingEvents { get; set; } | ||
|
||
/// <summary> | ||
/// When <see cref="IncludeContributingEvents"/> is <c>true</c>, the maximum number of contributing events to | ||
/// include in the notification. Note that this value is an upper limit, and server resource constraints may | ||
/// prevent all contributing events from being included even below this limit. | ||
/// </summary> | ||
public uint? IncludedContributingEventLimit { get; set; } | ||
|
||
/// <summary> | ||
/// The id of an <see cref="AppInstanceEntity"/> that will receive notifications from the alert. | ||
/// </summary> | ||
public string NotificationAppInstanceId { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that will be used to configure the notification app when triggered | ||
/// by the alert. | ||
/// </summary> | ||
public Dictionary<string, string> NotificationAppSettingOverrides { get; set; } = | ||
new Dictionary<string, string>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright Datalust and contributors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
namespace Seq.Api.Model.Cluster | ||
{ | ||
/// <summary> | ||
/// Describes a node in a Seq cluster. | ||
/// </summary> | ||
public class ClusterNodeEntity : Entity | ||
{ | ||
/// <summary> | ||
/// The role the node is currently acting in. | ||
/// </summary> | ||
public NodeRole Role { get; set; } | ||
|
||
/// <summary> | ||
/// An informational name associated with the node. | ||
/// </summary> | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// An informational representation of the storage generation committed to the node. | ||
/// </summary> | ||
public string Generation { get; set; } | ||
|
||
/// <summary> | ||
/// Whether any writes have occurred since the node's last completed sync. | ||
/// </summary> | ||
public bool? IsUpToDate { get; set; } | ||
|
||
/// <summary> | ||
/// The time since the node's last completed sync operation. | ||
/// </summary> | ||
public double? MillisecondsSinceLastSync { get; set; } | ||
|
||
/// <summary> | ||
/// An informational description of the node's current state, or <c langword="null">null</c> if no additional | ||
/// information about the node is available. | ||
/// </summary> | ||
public string StateDescription { get; set; } | ||
} | ||
} |
Oops, something went wrong.