Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7ff3795
updated plan
jonathanawesome Mar 30, 2026
0be673a
gemini suggestions
jonathanawesome Mar 30, 2026
a7b778e
prettier
jonathanawesome Mar 30, 2026
5503be7
Merge branch 'main' into console-1968-improve-most-valuable-alert-types
jonathanawesome Mar 30, 2026
4714cbc
add additional states to plan: NORMAL, PENDING, FIRING, RECOVERING
jonathanawesome Apr 9, 2026
ae2c487
rename metric_alerts to metric_alert_rules
jonathanawesome Apr 13, 2026
a1f5472
Merge branch 'main' into console-1968-improve-most-valuable-alert-types
jonathanawesome Apr 14, 2026
c3552fd
Merge branch 'main' into console-1968-improve-most-valuable-alert-types
jonathanawesome Apr 15, 2026
e41f725
Merge branch 'main' into console-1968-improve-most-valuable-alert-types
jonathanawesome Apr 15, 2026
5211d5e
shuffle email alert channel work, review figma screens
jonathanawesome Apr 16, 2026
7102e9e
add migration
jonathanawesome Apr 16, 2026
a5389dd
prettier
jonathanawesome Apr 16, 2026
0481f39
add .claude to prettierignore
jonathanawesome Apr 16, 2026
b563337
Merge branch 'main' into console-1968-improve-most-valuable-alert-types
jonathanawesome Apr 17, 2026
42e53e7
add metric alert rules entity types and storage provider
jonathanawesome Apr 17, 2026
e38889b
generate
jonathanawesome Apr 17, 2026
e92f120
add GraphQL schema and resolvers for metric alert rules
jonathanawesome Apr 17, 2026
10af3ff
add metric alert evaluation engine to workflows service
jonathanawesome Apr 17, 2026
707234e
add metric alert notification sender for Slack, Webhook, and Teams
jonathanawesome Apr 17, 2026
35cc93a
address review issues, add plan-based retention, add integration tests
jonathanawesome Apr 17, 2026
df87dd6
move Project.metricAlertRules to Target, add created_by_user_id
jonathanawesome Apr 17, 2026
b756a8b
Merge branch 'main' into console-1968-improve-most-valuable-alert-types
jonathanawesome Apr 17, 2026
9ad4638
add initial metric alerts seed script with 30 days history
jonathanawesome Apr 17, 2026
54d6c2d
scaffold alerts tab and sub routes
jonathanawesome Apr 17, 2026
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
1,105 changes: 1,105 additions & 0 deletions .claude/plans/alerts-and-notifications-improvements.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pnpm-lock.yaml
.bob/

.changeset/
.claude/
CHANGELOG.md

# temp volumes
Expand Down
89 changes: 89 additions & 0 deletions integration-tests/testkit/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { graphql } from './gql';
import type {
AddAlertChannelInput,
AddAlertInput,
AddMetricAlertRuleInput,
AnswerOrganizationTransferRequestInput,
AssignMemberRoleInput,
CreateMemberRoleInput,
Expand All @@ -11,6 +12,7 @@ import type {
CreateTargetInput,
CreateTokenInput,
DeleteMemberRoleInput,
DeleteMetricAlertRulesInput,
DeleteTokensInput,
Experimental__UpdateTargetSchemaCompositionInput,
InviteToOrganizationByEmailInput,
Expand All @@ -24,6 +26,7 @@ import type {
TargetSelectorInput,
UpdateBaseSchemaInput,
UpdateMemberRoleInput,
UpdateMetricAlertRuleInput,
UpdateOrganizationSlugInput,
UpdateProjectSlugInput,
UpdateSchemaCompositionInput,
Expand Down Expand Up @@ -647,6 +650,92 @@ export function addAlert(input: AddAlertInput, authToken: string) {
});
}

export function addMetricAlertRule(input: AddMetricAlertRuleInput, authToken: string) {
return execute({
document: graphql(`
mutation IntegrationTests_AddMetricAlertRule($input: AddMetricAlertRuleInput!) {
addMetricAlertRule(input: $input) {
ok {
addedMetricAlertRule {
id
name
type
metric
thresholdType
thresholdValue
direction
severity
state
timeWindowMinutes
confirmationMinutes
enabled
channels {
id
name
type
}
}
}
error {
message
}
}
}
`),
variables: { input },
authToken,
});
}

export function updateMetricAlertRule(input: UpdateMetricAlertRuleInput, authToken: string) {
return execute({
document: graphql(`
mutation IntegrationTests_UpdateMetricAlertRule($input: UpdateMetricAlertRuleInput!) {
updateMetricAlertRule(input: $input) {
ok {
updatedMetricAlertRule {
id
name
type
metric
thresholdType
thresholdValue
direction
severity
state
enabled
}
}
error {
message
}
}
}
`),
variables: { input },
authToken,
});
}

export function deleteMetricAlertRules(input: DeleteMetricAlertRulesInput, authToken: string) {
return execute({
document: graphql(`
mutation IntegrationTests_DeleteMetricAlertRules($input: DeleteMetricAlertRulesInput!) {
deleteMetricAlertRules(input: $input) {
ok {
deletedMetricAlertRuleIds
}
error {
message
}
}
}
`),
variables: { input },
authToken,
});
}

export function readOrganizationInfo(
selector: {
organizationSlug: string;
Expand Down
28 changes: 28 additions & 0 deletions integration-tests/testkit/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ensureEnv } from './env';
import {
addAlert,
addAlertChannel,
addMetricAlertRule,
assignMemberRole,
checkSchema,
compareToPreviousVersion,
Expand All @@ -30,6 +31,7 @@ import {
createTarget,
createToken,
deleteMemberRole,
deleteMetricAlertRules,
deleteSchema,
deleteTokens,
fetchLatestSchema,
Expand All @@ -51,6 +53,7 @@ import {
readTokenInfo,
updateBaseSchema,
updateMemberRole,
updateMetricAlertRule,
updateTargetValidationSettings,
} from './flow';
import * as GraphQLSchema from './gql/graphql';
Expand Down Expand Up @@ -814,6 +817,31 @@ export function initSeed() {
);
return result.addAlertChannel;
},
async addMetricAlertRule(
input: { token?: string } & Parameters<typeof addMetricAlertRule>[0],
) {
const result = await addMetricAlertRule(input, input.token || ownerToken).then(
r => r.expectNoGraphQLErrors(),
);
return result.addMetricAlertRule;
},
async updateMetricAlertRule(
input: { token?: string } & Parameters<typeof updateMetricAlertRule>[0],
) {
const result = await updateMetricAlertRule(input, input.token || ownerToken).then(
r => r.expectNoGraphQLErrors(),
);
return result.updateMetricAlertRule;
},
async deleteMetricAlertRules(
input: { token?: string } & Parameters<typeof deleteMetricAlertRules>[0],
) {
const result = await deleteMetricAlertRules(
input,
input.token || ownerToken,
).then(r => r.expectNoGraphQLErrors());
return result.deleteMetricAlertRules;
},
/**
* Create an access token for a given target.
* This token can be used for usage reporting and all actions that would be performed by the CLI.
Expand Down
Loading
Loading