mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
perf: add index for pulling alert histories (GET alerts endpoint) (#221)
This commit is contained in:
parent
0ce932847f
commit
bfb08f89e4
2 changed files with 8 additions and 0 deletions
6
.changeset/tall-rats-hunt.md
Normal file
6
.changeset/tall-rats-hunt.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
'@hyperdx/api': patch
|
||||
'@hyperdx/app': patch
|
||||
---
|
||||
|
||||
perf: add index for pulling alert histories (GET alerts endpoint)
|
||||
|
|
@ -47,6 +47,8 @@ AlertHistorySchema.index(
|
|||
{ expireAfterSeconds: ms('30d') / 1000 },
|
||||
);
|
||||
|
||||
AlertHistorySchema.index({ alert: 1, createdAt: -1 });
|
||||
|
||||
export default mongoose.model<IAlertHistory>(
|
||||
'AlertHistory',
|
||||
AlertHistorySchema,
|
||||
|
|
|
|||
Loading…
Reference in a new issue