Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
502934a
feat: add state to the alert template
wrn14897 Oct 25, 2025
9477b61
feat: add 'startTime', 'endTime' and 'eventId' to the alert template
wrn14897 Oct 25, 2025
6bfb7c2
fix: use alertId instead
wrn14897 Oct 25, 2025
f8be874
feat: incident.io HTTP integration
wrn14897 Oct 25, 2025
69289c1
fix: eventId should be unique regardless of time window
wrn14897 Oct 25, 2025
908aa37
feat: implement auto resolve
wrn14897 Oct 25, 2025
80a72ce
style: use if-else in the template for incident.io status mapping
wrn14897 Oct 25, 2025
e0a1f91
docs: add changesets
wrn14897 Oct 25, 2025
91512ad
feedback: enrich eventId (dedupe key) + fetch state from alert history
wrn14897 Oct 26, 2025
6e346c4
docs: add a comment
wrn14897 Oct 27, 2025
26f3028
fix: handle group-by alerts (should fire/resolve multiple ones)
wrn14897 Oct 27, 2025
1e5731c
fix: fill out missing group-by alert histories
wrn14897 Oct 28, 2025
2ebc903
ci: add more tests
wrn14897 Oct 28, 2025
2f8d73e
feedback: address inconsistent histories vs alert state
wrn14897 Oct 28, 2025
011759d
docs: update changeset
wrn14897 Oct 28, 2025
bfc85b7
feedback: styles + types
wrn14897 Oct 28, 2025
e14aa18
feedback: deprecate 'previous' and move codes to updateAlertState
wrn14897 Oct 28, 2025
5d77a0f
feadback: handle hybrid group-by alertid in previousMap
wrn14897 Oct 29, 2025
f9a2baa
docs: add a comment
wrn14897 Oct 30, 2025
23a7e4b
ci: add a int test for multi buckets check
wrn14897 Oct 30, 2025
2a3adce
feedback: take the latest datetime from the group
wrn14897 Nov 4, 2025
3f3231c
Merge branch 'main' into warren/introduce-alert-state-var-and-auto-re…
kodiakhq[bot] Nov 4, 2025
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
7 changes: 7 additions & 0 deletions .changeset/brave-meals-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@hyperdx/common-utils": minor
"@hyperdx/api": minor
"@hyperdx/app": minor
---

feat: add support for alert auto-resolve
7 changes: 7 additions & 0 deletions .changeset/friendly-apricots-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@hyperdx/common-utils": patch
"@hyperdx/api": patch
"@hyperdx/app": patch
---

feat: support incident.io integration
7 changes: 7 additions & 0 deletions .changeset/good-feet-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@hyperdx/common-utils": patch
"@hyperdx/api": patch
"@hyperdx/app": patch
---

fix: handle group-by alert histories
1 change: 1 addition & 0 deletions packages/api/src/controllers/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import logger from '@/utils/logger';
import { alertSchema } from '@/utils/zod';

export type AlertInput = {
id?: string;
source?: AlertSource;
channel: AlertChannel;
interval: AlertInterval;
Expand Down
8 changes: 8 additions & 0 deletions packages/api/src/models/alertHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface IAlertHistory {
createdAt: Date;
state: AlertState;
lastValues: { startTime: Date; count: number }[];
group?: string; // For group-by alerts, stores the group identifier
}

const AlertHistorySchema = new Schema<IAlertHistory>({
Expand Down Expand Up @@ -40,13 +41,20 @@ const AlertHistorySchema = new Schema<IAlertHistory>({
},
},
],
group: {
type: String,
required: false,
},
});

AlertHistorySchema.index(
{ createdAt: 1 },
{ expireAfterSeconds: ms('30d') / 1000 },
);

// Compound index for querying alert histories by alert and time
// Used by getPreviousAlertHistories and alerts router
// Supports queries like: { alert: id, createdAt: { $lte: date } } with sort { createdAt: -1 }
AlertHistorySchema.index({ alert: 1, createdAt: -1 });

export default mongoose.model<IAlertHistory>(
Expand Down
6 changes: 2 additions & 4 deletions packages/api/src/models/webhook.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { WebhookService } from '@hyperdx/common-utils/dist/types';
import { ObjectId } from 'mongodb';
import mongoose, { Schema } from 'mongoose';

export enum WebhookService {
Slack = 'slack',
Generic = 'generic',
}
export { WebhookService };

interface MongooseMap extends Map<string, string> {
// https://mongoosejs.com/docs/api/map.html#MongooseMap.prototype.toJSON()
Expand Down
Loading
Loading