Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitor Alerts #1727

Merged
merged 51 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ae493aa
feat: Add MoreMenu component and related functionality for enhanced U…
simlarsen Oct 1, 2024
84fcb26
feat: Add logging to API Post component for better debugging
simlarsen Oct 1, 2024
a2e71af
Merge branch 'master' into table-filters
simlarsen Oct 1, 2024
7c941da
add table view table
simlarsen Oct 2, 2024
c833bcb
add table filters model
simlarsen Oct 2, 2024
fd15e66
add table view save settings.
simlarsen Oct 2, 2024
bc0e8e3
integrate table view filters with base model table
simlarsen Oct 2, 2024
c789438
add migration script for table views
simlarsen Oct 2, 2024
e5bb7dc
add alert models
simlarsen Oct 2, 2024
7a0cf31
add alert internal note model
simlarsen Oct 2, 2024
1c6a242
add owner models
simlarsen Oct 2, 2024
c217eea
add alert custom fields.
simlarsen Oct 2, 2024
2f47a3e
add service for alerts
simlarsen Oct 2, 2024
22f5633
add default alert severity
simlarsen Oct 2, 2024
cb8cf08
add alert services
simlarsen Oct 2, 2024
333b06b
add alert services to index
simlarsen Oct 2, 2024
eaed1f8
add alert api's to index
simlarsen Oct 2, 2024
ae79417
add rotue paths to alerts
simlarsen Oct 2, 2024
e6b47d8
add breadcrumbs
simlarsen Oct 2, 2024
cc1d60a
add alert change state element
simlarsen Oct 2, 2024
bf63bad
add alerts to nav bar
simlarsen Oct 2, 2024
56e8c24
fix lint
simlarsen Oct 2, 2024
d60d9c5
add alert mail templates
simlarsen Oct 2, 2024
f25f7f1
add jobs for alerts
simlarsen Oct 2, 2024
11a4f34
add alert jobs in worker
simlarsen Oct 2, 2024
49a2ee1
add alerts to monitor step
simlarsen Oct 2, 2024
249a9d9
Merge branch 'table-filters' into monitor-alert
simlarsen Oct 2, 2024
b624bd4
add migration for alerts
simlarsen Oct 2, 2024
bb5a019
enhance alert permissions and add alert routes
simlarsen Oct 3, 2024
4a7ac0f
add monitor alerts
simlarsen Oct 3, 2024
cfc1fb4
Refactor MonitorPage and TableView components
simlarsen Oct 3, 2024
591b3ab
Refactor TableView component and fix indentation
simlarsen Oct 3, 2024
facc564
Refactor MonitorCriteriaInstance to handle null incidents and alerts
simlarsen Oct 3, 2024
c8d4bea
Refactor AlertsTable component and update route in DashboardSideMenu
simlarsen Oct 3, 2024
b0a4bcc
Refactor AlertNoteTemplateView and AlertNoteTemplateViews components
simlarsen Oct 3, 2024
8e2336f
Refactor AlertNoteTemplateViews component and create AlertNoteTemplat…
simlarsen Oct 3, 2024
b151eaa
Refactor AlertNoteTemplateView component and create AlertNoteTemplate…
simlarsen Oct 3, 2024
7a052d6
Refactor AlertNoteTemplateViews component and create AlertNoteTemplat…
simlarsen Oct 3, 2024
25f2d52
Refactor AlertNoteTemplateView component and create NoteTemplate comp…
simlarsen Oct 3, 2024
b559696
Refactor NoteTemplate component to AlertNoteTemplateDetail component
simlarsen Oct 3, 2024
54cd188
Refactor SideMenu component in Settings page
simlarsen Oct 4, 2024
6acb0fb
add alerts page to monitor groups
simlarsen Oct 4, 2024
4be7675
add active alerts to home page
simlarsen Oct 4, 2024
f08dbf6
fix issue with monitor group
simlarsen Oct 4, 2024
d17b687
add alert types to model alert
simlarsen Oct 4, 2024
7eebd75
add types to header alert
simlarsen Oct 4, 2024
30db4e5
refactor UI of header alerts
simlarsen Oct 4, 2024
09955a5
add header group
simlarsen Oct 4, 2024
97bf26a
make header alerts work
simlarsen Oct 4, 2024
add1180
add default alert severity id
simlarsen Oct 4, 2024
7a38a0d
fix rule in monitor criteria
simlarsen Oct 4, 2024
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
122 changes: 122 additions & 0 deletions App/FeatureSet/BaseAPI/Index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,35 @@ import TelemetryIngestionKeyService, {
import EmailVerificationTokenService, {
Service as EmailVerificationTokenServiceType,
} from "Common/Server/Services/EmailVerificationTokenService";

import AlertCustomFieldService, {
Service as AlertCustomFieldServiceType,
} from "Common/Server/Services/AlertCustomFieldService";
import AlertInternalNoteService, {
Service as AlertInternalNoteServiceType,
} from "Common/Server/Services/AlertInternalNoteService";
import AlertNoteTemplateService, {
Service as AlertNoteTemplateServiceType,
} from "Common/Server/Services/AlertNoteTemplateService";
import AlertOwnerTeamService, {
Service as AlertOwnerTeamServiceType,
} from "Common/Server/Services/AlertOwnerTeamService";
import AlertOwnerUserService, {
Service as AlertOwnerUserServiceType,
} from "Common/Server/Services/AlertOwnerUserService";
import AlertService, {
Service as AlertServiceType,
} from "Common/Server/Services/AlertService";
import AlertSeverityService, {
Service as AlertSeverityServiceType,
} from "Common/Server/Services/AlertSeverityService";
import AlertStateService, {
Service as AlertStateServiceType,
} from "Common/Server/Services/AlertStateService";
import AlertStateTimelineService, {
Service as AlertStateTimelineServiceType,
} from "Common/Server/Services/AlertStateTimelineService";

import IncidentCustomFieldService, {
Service as IncidentCustomFieldServiceType,
} from "Common/Server/Services/IncidentCustomFieldService";
Expand All @@ -55,6 +84,9 @@ import IncidentInternalNoteService, {
import IncidentNoteTemplateService, {
Service as IncidentNoteTemplateServiceType,
} from "Common/Server/Services/IncidentNoteTemplateService";
import TableViewService, {
Service as TableViewServiceType,
} from "Common/Server/Services/TableViewService";
import IncidentOwnerTeamService, {
Service as IncidentOwnerTeamServiceType,
} from "Common/Server/Services/IncidentOwnerTeamService";
Expand Down Expand Up @@ -342,6 +374,17 @@ import CallLog from "Common/Models/DatabaseModels/CallLog";
import Domain from "Common/Models/DatabaseModels/Domain";
import EmailLog from "Common/Models/DatabaseModels/EmailLog";
import EmailVerificationToken from "Common/Models/DatabaseModels/EmailVerificationToken";

import Alert from "Common/Models/DatabaseModels/Alert";
import AlertCustomField from "Common/Models/DatabaseModels/AlertCustomField";
import AlertInternalNote from "Common/Models/DatabaseModels/AlertInternalNote";
import AlertNoteTemplate from "Common/Models/DatabaseModels/AlertNoteTemplate";
import AlertOwnerTeam from "Common/Models/DatabaseModels/AlertOwnerTeam";
import AlertOwnerUser from "Common/Models/DatabaseModels/AlertOwnerUser";
import AlertSeverity from "Common/Models/DatabaseModels/AlertSeverity";
import AlertState from "Common/Models/DatabaseModels/AlertState";
import AlertStateTimeline from "Common/Models/DatabaseModels/AlertStateTimeline";

import Incident from "Common/Models/DatabaseModels/Incident";
import IncidentCustomField from "Common/Models/DatabaseModels/IncidentCustomField";
import IncidentInternalNote from "Common/Models/DatabaseModels/IncidentInternalNote";
Expand All @@ -355,6 +398,7 @@ import IncidentStateTimeline from "Common/Models/DatabaseModels/IncidentStateTim
import IncidentTemplate from "Common/Models/DatabaseModels/IncidentTemplate";
import IncidentTemplateOwnerTeam from "Common/Models/DatabaseModels/IncidentTemplateOwnerTeam";
import IncidentTemplateOwnerUser from "Common/Models/DatabaseModels/IncidentTemplateOwnerUser";

import Label from "Common/Models/DatabaseModels/Label";
import Monitor from "Common/Models/DatabaseModels/Monitor";
import MonitorCustomField from "Common/Models/DatabaseModels/MonitorCustomField";
Expand Down Expand Up @@ -443,6 +487,7 @@ import ScheduledMaintenanceTemplateOwnerTeamService, {
import ScheduledMaintenanceTemplateOwnerUserService, {
Service as ScheduledMaintenanceTemplateOwnerUserServiceType,
} from "Common/Server/Services/ScheduledMaintenanceTemplateOwnerUserService";
import TableView from "Common/Models/DatabaseModels/TableView";

const BaseAPIFeatureSet: FeatureSet = {
init: async (): Promise<void> => {
Expand All @@ -458,6 +503,75 @@ const BaseAPIFeatureSet: FeatureSet = {
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<AlertState, AlertStateServiceType>(
AlertState,
AlertStateService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<AlertNoteTemplate, AlertNoteTemplateServiceType>(
AlertNoteTemplate,
AlertNoteTemplateService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<Alert, AlertServiceType>(Alert, AlertService).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<AlertSeverity, AlertSeverityServiceType>(
AlertSeverity,
AlertSeverityService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<AlertOwnerTeam, AlertOwnerTeamServiceType>(
AlertOwnerTeam,
AlertOwnerTeamService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<AlertOwnerUser, AlertOwnerUserServiceType>(
AlertOwnerUser,
AlertOwnerUserService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<AlertCustomField, AlertCustomFieldServiceType>(
AlertCustomField,
AlertCustomFieldService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<AlertInternalNote, AlertInternalNoteServiceType>(
AlertInternalNote,
AlertInternalNoteService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<AlertStateTimeline, AlertStateTimelineServiceType>(
AlertStateTimeline,
AlertStateTimelineService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAnalyticsAPI<ExceptionInstance, ExceptionInstanceServiceType>(
Expand Down Expand Up @@ -776,6 +890,14 @@ const BaseAPIFeatureSet: FeatureSet = {
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<TableView, TableViewServiceType>(
TableView,
TableViewService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<IncidentState, IncidentStateServiceType>(
Expand Down
37 changes: 37 additions & 0 deletions App/FeatureSet/Notification/Templates/AcknowledgeAlert.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{> Start this}}


{{> Logo this}}
{{> EmailTitle title=(concat "Alert: " alertTitle) }}

{{> InfoBlock info=(concat "A new alert has been created in the project - " projectName)}}

{{> InfoBlock info="Here are the details: "}}

{{> DetailBoxStart this }}
{{> DetailBoxField title="Alert Title:" text=alertTitle }}
{{> DetailBoxField title="Current State: " text=currentState }}
{{> DetailBoxField title="Resources Affected: " text=resourcesAffected }}
{{> DetailBoxField title="Severity: " text=alertSeverity }}
{{> DetailBoxField title="Root Cause: " text="" }}
{{> DetailBoxField title="" text=rootCause }}
{{> DetailBoxField title="Description: " text="" }}
{{> DetailBoxField title="" text=alertDescription }}
{{> DetailBoxEnd this }}


{{> InfoBlock info="ACTION REQUIRED: Please acknowledge this alert by clicking on the button below - "}}

{{> ButtonBlock buttonUrl=acknowledgeAlertLink buttonText="Acknowledge Alert"}}

{{> InfoBlock info="You can also copy and paste this link:"}}
{{> InfoBlock info=acknowledgeAlertLink}}

{{> InfoBlock info="You will be notified when the status of this alert changes."}}

{{> TitleBlock title="Why am I receiving this email?"}}
{{> InfoBlock info="You are receiving this email because you are a member of the team that is responsible for this alert or you are currently on-call."}}

{{> Footer this }}

{{> End this}}
32 changes: 32 additions & 0 deletions App/FeatureSet/Notification/Templates/AlertOwnerAdded.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{> Start this}}


{{> Logo this}}
{{> EmailTitle title=(concat "Alert: " alertTitle) }}

{{> InfoBlock info="You have been added as the owner of this alert."}}

{{> InfoBlock info="Here are the details: "}}

{{> DetailBoxStart this }}
{{> DetailBoxField title="Alert Title:" text=alertTitle }}
{{> DetailBoxField title="Current State: " text=currentState }}
{{> DetailBoxField title="Resources Affected: " text=resourcesAffected }}
{{> DetailBoxField title="Severity: " text=alertSeverity }}
{{> DetailBoxField title="Description: " text="" }}
{{> DetailBoxField title="" text=alertDescription }}
{{> DetailBoxEnd this }}


{{> InfoBlock info="You can view this alert by clicking on the button below - "}}

{{> ButtonBlock buttonUrl=alertViewLink buttonText="View on Dashboard"}}

{{> InfoBlock info="You can also copy and paste this link:"}}
{{> InfoBlock info=alertViewLink}}

{{> InfoBlock info="You will be notified when the status of this alert changes."}}

{{> Footer this }}

{{> End this}}
39 changes: 39 additions & 0 deletions App/FeatureSet/Notification/Templates/AlertOwnerNotePosted.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{> Start this}}


{{> Logo this}}
{{> EmailTitle title=(concat "Alert: " alertTitle) }}

{{> InfoBlock info="A new note has been posted on this alert."}}

{{> InfoBlock info="Here are the details: "}}

{{> DetailBoxStart this }}
{{> DetailBoxField title="Alert Title:" text=alertTitle }}
{{> DetailBoxField title="Current State: " text=currentState }}
{{> DetailBoxField title="Resources Affected: " text=resourcesAffected }}
{{> DetailBoxField title="Severity: " text=alertSeverity }}
{{#if isPrivateNote}}
{{> DetailBoxField title="Private Note: " text="" }}
{{else}}
{{> DetailBoxField title="Public Note: " text="" }}
{{/if}}
{{> DetailBoxField title="" text=note }}
{{> DetailBoxEnd this }}


{{> InfoBlock info="You can view this alert by clicking on the button below - "}}

{{> ButtonBlock buttonUrl=alertViewLink buttonText="View on Dashboard"}}

{{> InfoBlock info="You can also copy and paste this link:"}}
{{> InfoBlock info=alertViewLink}}

{{> InfoBlock info="You will be notified when the status of this alert changes."}}

{{> OwnerInfo this }}
{{> UnsubscribeOwnerEmail this }}

{{> Footer this }}

{{> End this}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{> Start this}}


{{> Logo this}}
{{> EmailTitle title=(concat "Alert: " alertTitle) }}

{{> InfoBlock info=(concat "A new alert has been created in the project - " projectName)}}

{{> InfoBlock info="Here are the details: "}}

{{> DetailBoxStart this }}
{{> DetailBoxField title="Alert Title:" text=alertTitle }}
{{> DetailBoxField title="Current State: " text=currentState }}
{{> DetailBoxField title="Resources Affected: " text=resourcesAffected }}
{{> DetailBoxField title="Alert Declared By: " text=declaredBy }}
{{> DetailBoxField title="Alert Declared At: " text="" }}
{{> DetailBoxField title="" text=declaredAt }}
{{> DetailBoxField title="Severity: " text=alertSeverity }}
{{> DetailBoxField title="Root Cause: " text="" }}
{{> DetailBoxField title="" text=rootCause }}
{{> DetailBoxField title="Description: " text="" }}
{{> DetailBoxField title="" text=alertDescription }}
{{#ifNotCond remediationNotes ""}}
{{> DetailBoxField title="Remediation Notes: " text="" }}
{{> DetailBoxField title="" text=remediationNotes }}
{{/ifNotCond}}
{{> DetailBoxEnd this }}


{{> InfoBlock info="You can view this alert by clicking on the button below - "}}

{{> ButtonBlock buttonUrl=alertViewLink buttonText="View on Dashboard"}}

{{> InfoBlock info="You can also copy and paste this link:"}}
{{> InfoBlock info=alertViewLink}}

{{> InfoBlock info="You will be notified when the status of this alert changes."}}

{{> OwnerInfo this }}
{{> UnsubscribeOwnerEmail this }}

{{> Footer this }}

{{> End this}}
37 changes: 37 additions & 0 deletions App/FeatureSet/Notification/Templates/AlertOwnerStateChanged.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{> Start this}}


{{> Logo this}}
{{> EmailTitle title=(concat "Alert: " alertTitle) }}

{{> InfoBlock info=(concat "Alert state changed to - " currentState)}}

{{> InfoBlock info="Here are the details: "}}

{{> DetailBoxStart this }}
{{> DetailBoxField title="Alert Title:" text=alertTitle }}
{{> DetailBoxField title="New State: " text=currentState }}
{{> DetailBoxField title="State changed at: " text="" }}
{{> DetailBoxField title="" text=stateChangedAt }}
{{> DetailBoxField title="Resources Affected: " text=resourcesAffected }}
{{> DetailBoxField title="Severity: " text=alertSeverity }}
{{> DetailBoxField title="Description: " text="" }}
{{> DetailBoxField title="" text=alertDescription }}
{{> DetailBoxEnd this }}


{{> InfoBlock info="You can view this alert by clicking on the button below - "}}

{{> ButtonBlock buttonUrl=alertViewLink buttonText="View on Dashboard"}}

{{> InfoBlock info="You can also copy and paste this link:"}}
{{> InfoBlock info=alertViewLink}}

{{> InfoBlock info="You will be notified when the status of this alert changes."}}

{{> OwnerInfo this }}
{{> UnsubscribeOwnerEmail this }}

{{> Footer this }}

{{> End this}}
Loading
Loading