Skip to content

Commit

Permalink
fix(slo): Slices without any data event are considered good (elastic#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme authored Oct 23, 2024
1 parent 96c6aa7 commit 75f6db1
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ export class ApmTransactionDurationTransformGenerator extends TransformGenerator
goodEvents: 'slo.numerator.value',
totalEvents: 'slo.denominator.value',
},
script: `params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
script: `if (params.totalEvents == 0) { return 1 } else { return params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
slo.objective.timesliceTarget!
)} ${slo.objective.timesliceTarget} ? 1 : 0`,
)} ${slo.objective.timesliceTarget} ? 1 : 0 }`,
},
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ export class ApmTransactionErrorRateTransformGenerator extends TransformGenerato
goodEvents: 'slo.numerator>_count',
totalEvents: 'slo.denominator>_count',
},
script: `params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
script: `if (params.totalEvents == 0) { return 1 } else { return params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
slo.objective.timesliceTarget!
)} ${slo.objective.timesliceTarget} ? 1 : 0`,
)} ${slo.objective.timesliceTarget} ? 1 : 0 }`,
},
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ export class HistogramTransformGenerator extends TransformGenerator {
goodEvents: 'slo.numerator>value',
totalEvents: 'slo.denominator>value',
},
script: `params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
script: `if (params.totalEvents == 0) { return 1 } else { return params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
slo.objective.timesliceTarget!
)} ${slo.objective.timesliceTarget} ? 1 : 0`,
)} ${slo.objective.timesliceTarget} ? 1 : 0 }`,
},
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ export class KQLCustomTransformGenerator extends TransformGenerator {
goodEvents: 'slo.numerator>_count',
totalEvents: 'slo.denominator>_count',
},
script: `params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
script: `if (params.totalEvents == 0) { return 1 } else { return params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
slo.objective.timesliceTarget!
)} ${slo.objective.timesliceTarget} ? 1 : 0`,
)} ${slo.objective.timesliceTarget} ? 1 : 0 }`,
},
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ export class MetricCustomTransformGenerator extends TransformGenerator {
goodEvents: 'slo.numerator>value',
totalEvents: 'slo.denominator>value',
},
script: `params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
script: `if (params.totalEvents == 0) { return 1 } else { return params.goodEvents / params.totalEvents ${getTimesliceTargetComparator(
slo.objective.timesliceTarget!
)} ${slo.objective.timesliceTarget} ? 1 : 0`,
)} ${slo.objective.timesliceTarget} ? 1 : 0 }`,
},
},
}),
Expand Down

0 comments on commit 75f6db1

Please sign in to comment.