Skip to content

Commit

Permalink
Add filter agg to healthy SLO agg to remove stale SLOs from doc_count.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Nov 22, 2024
1 parent 0366d25 commit b73f0c4
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ export class GetSLOsOverview {
status: 'HEALTHY',
},
},
aggs: {
not_stale: {
filter: {
range: {
summaryUpdatedAt: {
gte: 'now-48h',
},
},
},
},
},
},
degrading: {
filter: {
Expand Down Expand Up @@ -133,7 +144,7 @@ export class GetSLOsOverview {
return {
violated: aggs?.violated.doc_count ?? 0,
degrading: aggs?.degrading.doc_count ?? 0,
healthy: aggs?.healthy.doc_count ?? 0,
healthy: aggs?.healthy?.not_stale?.doc_count ?? 0,
noData: aggs?.noData.doc_count ?? 0,
stale: aggs?.stale.doc_count ?? 0,
worst: {
Expand Down

0 comments on commit b73f0c4

Please sign in to comment.