-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AO] Add evaluation values for metric threshold and inventory rules #154255
[AO] Add evaluation values for metric threshold and inventory rules #154255
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
.../infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts
Outdated
Show resolved
Hide resolved
@@ -77,7 +77,7 @@ type CastSingle<T extends t.Type<any>> = t.Type< | |||
>; | |||
|
|||
const createCastArrayRt = <T extends t.Type<any>>(type: T): CastArray<T> => { | |||
const union = t.union([type, t.array(type)]); | |||
const union = t.union([type, t.array(t.union([type, t.nullType]))]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is related to the values that are saved in kibana.alert.evaluation.values
, it is a mixture of the specified type (scaled_float
) and null
Pinging @elastic/actionable-observability (Team: Actionable Observability) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge code with grace,
This PR shines, well-crafted,
Approving eyes smile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Infra changes LGTM!
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response ops changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #153877
Summary
This PR adds a new field called
kibana.alert.evaluation.values
to the alert document for metric threshold and inventory rules. This is an array of numbers but depending on the result of the rule execution, the value might benull
too.We want to use this result in the metric threshold alert details page, so I checked whether this value can be retrieved correctly there or not:

Note
I will add tests later, I would like to get feedback about the implementation first.
🧪 How to test
kibana.alert.evaluation.values
field, it should be an array with the result of evaluation for the related criteriakibana.alert.evaluation.values
field, it should be an array including a null value