Skip to content

Commit

Permalink
[8.x] fix(slo): Slices without any data event are considered good (#1…
Browse files Browse the repository at this point in the history
…96942) (#197434)

# Backport

This will backport the following commits from `main` to `8.x`:
- [fix(slo): Slices without any data event are considered good
(#196942)](#196942)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kevin
Delemme","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-23T13:03:42Z","message":"fix(slo):
Slices without any data event are considered good
(#196942)","sha":"75f6db10bd1afeeab00bc9265ae7090a197f9e8f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","backport:prev-major","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0"],"title":"fix(slo):
Slices without any data event are considered
good","number":196942,"url":"https://github.com/elastic/kibana/pull/196942","mergeCommit":{"message":"fix(slo):
Slices without any data event are considered good
(#196942)","sha":"75f6db10bd1afeeab00bc9265ae7090a197f9e8f"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196942","number":196942,"mergeCommit":{"message":"fix(slo):
Slices without any data event are considered good
(#196942)","sha":"75f6db10bd1afeeab00bc9265ae7090a197f9e8f"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Kevin Delemme <[email protected]>
  • Loading branch information
kibanamachine and kdelemme authored Oct 23, 2024
1 parent b71995b commit 3d3ba69
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 3d3ba69

Please sign in to comment.