[9.0] [DOCS] Add missing descriptions for metrics.alert.threshold rule (#213181) (#221994)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[DOCS] Add missing descriptions for metrics.alert.threshold rule
(#213181)](https://github.com/elastic/kibana/pull/213181)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"lcawley@elastic.co"},"sourceCommit":{"committedDate":"2025-05-30T03:37:57Z","message":"[DOCS]
Add missing descriptions for metrics.alert.threshold rule
(#213181)","sha":"22b9669d34db2c26828d3dc2c48dd139b7e2ed9f","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","documentation","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[DOCS]
Add missing descriptions for metrics.alert.threshold
rule","number":213181,"url":"https://github.com/elastic/kibana/pull/213181","mergeCommit":{"message":"[DOCS]
Add missing descriptions for metrics.alert.threshold rule
(#213181)","sha":"22b9669d34db2c26828d3dc2c48dd139b7e2ed9f"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213181","number":213181,"mergeCommit":{"message":"[DOCS]
Add missing descriptions for metrics.alert.threshold rule
(#213181)","sha":"22b9669d34db2c26828d3dc2c48dd139b7e2ed9f"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Lisa Cawley <lcawley@elastic.co>
This commit is contained in:
Kibana Machine 2025-05-30 07:21:17 +02:00 committed by GitHub
parent 70630ae1ba
commit 0685ede64b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 198 additions and 9 deletions

View file

@ -65779,6 +65779,8 @@ components:
type: array
items:
type: number
description: |
The threshold value that is used with the `comparator`. If the `comparator` is `between`, you must specify the boundary values.
comparator:
type: string
enum:
@ -65788,14 +65790,27 @@ components:
- '>='
- between
- outside
description: |
The comparison function for the threshold. For example, "is above", "is above or equals", "is below", "is below or equals", "is between", and "outside".
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: |
The size of the time window (in `timeUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
type: number
description: |
The threshold value that is used with the `warningComparator`. If the `warningComparator` is `between`, you must specify the boundary values.
warningComparator:
type: string
enum:
@ -65838,8 +65853,17 @@ components:
- outside
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: |
The size of the time window (in `timeUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
@ -65875,8 +65899,17 @@ components:
- outside
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: |
The size of the time window (in `timeUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
@ -65910,6 +65943,8 @@ components:
- max
- min
- cardinality
description: |
An aggregation to gather data for the rule. For example, find the average, highest or lowest value of a numeric field. Or use a cardinality aggregation to find the approximate number of unique values in a field.
field:
type: string
- type: object
@ -65932,14 +65967,22 @@ components:
- type: array
items:
type: string
description: |
Create an alert for every unique value of the specified fields. For example, you can create a rule per host or every mount point of each host.
IMPORTANT: If you include the same field in both the `filterQuery` and `groupBy`, you might receive fewer results than you expect. For example, if you filter by `cloud.region: us-east`, grouping by `cloud.region` will have no effect because the filter query can match only one region.
filterQuery:
type: string
description: |
A query that limits the scope of the rule. The rule evaluates only metric data that matches the query.
sourceId:
type: string
alertOnNoData:
type: boolean
description: If true, an alert occurs if the metrics do not report any data over the expected period or if the query fails.
alertOnGroupDisappear:
type: boolean
description: |
If true, an alert occurs if a group that previously reported metrics does not report them again over the expected time period. This check is not recommended for dynamically scaling infrastructures that might rapidly start and stop nodes automatically.
params_property_slo_burn_rate:
properties:
sloId:

View file

@ -73080,6 +73080,8 @@ components:
type: array
items:
type: number
description: |
The threshold value that is used with the `comparator`. If the `comparator` is `between`, you must specify the boundary values.
comparator:
type: string
enum:
@ -73089,14 +73091,27 @@ components:
- '>='
- between
- outside
description: |
The comparison function for the threshold. For example, "is above", "is above or equals", "is below", "is below or equals", "is between", and "outside".
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: |
The size of the time window (in `timeUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
type: number
description: |
The threshold value that is used with the `warningComparator`. If the `warningComparator` is `between`, you must specify the boundary values.
warningComparator:
type: string
enum:
@ -73139,8 +73154,17 @@ components:
- outside
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: |
The size of the time window (in `timeUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
@ -73176,8 +73200,17 @@ components:
- outside
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: |
The size of the time window (in `timeUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
@ -73211,6 +73244,8 @@ components:
- max
- min
- cardinality
description: |
An aggregation to gather data for the rule. For example, find the average, highest or lowest value of a numeric field. Or use a cardinality aggregation to find the approximate number of unique values in a field.
field:
type: string
- type: object
@ -73233,14 +73268,22 @@ components:
- type: array
items:
type: string
description: |
Create an alert for every unique value of the specified fields. For example, you can create a rule per host or every mount point of each host.
IMPORTANT: If you include the same field in both the `filterQuery` and `groupBy`, you might receive fewer results than you expect. For example, if you filter by `cloud.region: us-east`, grouping by `cloud.region` will have no effect because the filter query can match only one region.
filterQuery:
type: string
description: |
A query that limits the scope of the rule. The rule evaluates only metric data that matches the query.
sourceId:
type: string
alertOnNoData:
type: boolean
description: If true, an alert occurs if the metrics do not report any data over the expected period or if the query fails.
alertOnGroupDisappear:
type: boolean
description: |
If true, an alert occurs if a group that previously reported metrics does not report them again over the expected time period. This check is not recommended for dynamically scaling infrastructures that might rapidly start and stop nodes automatically.
params_property_slo_burn_rate:
properties:
sloId:

View file

@ -32,11 +32,34 @@ const METRIC_EXPLORER_AGGREGATIONS = [
const comparator = Object.values({ ...COMPARATORS, ...LEGACY_COMPARATORS });
const baseCriterion = {
threshold: schema.arrayOf(schema.number()),
threshold: schema.arrayOf(schema.number(), {
meta: {
description:
'The threshold value that is used with the `comparator`. If the `comparator` is `between`, you must specify the boundary values.',
},
}),
comparator: oneOfLiterals(comparator),
timeUnit: schema.string(),
timeSize: schema.number(),
warningThreshold: schema.maybe(schema.arrayOf(schema.number())),
timeUnit: schema.string({
meta: {
description: 'The type of units for the time window: seconds, minutes, hours, or days.',
},
}),
timeSize: schema.number({
meta: {
description:
'The size of the time window (in `timeUnit` units), which determines how far back to search for documents. Generally it should be a value higher than the rule check interval to avoid gaps in detection.',
},
}),
warningThreshold: schema.maybe(
schema.arrayOf(
schema.number({
meta: {
description:
'The threshold value that is used with the `warningComparator`. If the `warningComparator` is `between`, you must specify the boundary values.',
},
})
)
),
warningComparator: schema.maybe(oneOfLiterals(comparator)),
};
@ -85,15 +108,40 @@ const customCriterion = schema.object({
export const metricThresholdRuleParamsSchema = schema.object(
{
criteria: schema.arrayOf(schema.oneOf([countCriterion, nonCountCriterion, customCriterion])),
groupBy: schema.maybe(schema.oneOf([schema.string(), schema.arrayOf(schema.string())])),
groupBy: schema.maybe(
schema.oneOf([schema.string(), schema.arrayOf(schema.string())], {
meta: {
description:
'Create an alert for every unique value of the specified fields. For example, you can create a rule per host or every mount point of each host. IMPORTANT: If you include the same field in both the `filterQuery` and `groupBy`, you might receive fewer results than you expect. For example, if you filter by `cloud.region: us-east`, grouping by `cloud.region` will have no effect because the filter query can match only one region.',
},
})
),
filterQuery: schema.maybe(
schema.string({
validate: validateIsStringElasticsearchJSONFilter,
meta: {
description:
'A query that limits the scope of the rule. The rule evaluates only metric data that matches the query.',
},
})
),
sourceId: schema.string(),
alertOnNoData: schema.maybe(schema.boolean()),
alertOnGroupDisappear: schema.maybe(schema.boolean()),
alertOnNoData: schema.maybe(
schema.boolean({
meta: {
description:
'If true, an alert occurs if the metrics do not report any data over the expected period or if the query fails.',
},
})
),
alertOnGroupDisappear: schema.maybe(
schema.boolean({
meta: {
description:
'If true, an alert occurs if a group that previously reported metrics does not report them again over the expected time period. This check is not recommended for dynamically scaling infrastructures that might rapidly start and stop nodes automatically.',
},
})
),
},
{ unknowns: 'allow' }
);

View file

@ -12,6 +12,9 @@ properties:
type: array
items:
type: number
description: >
The threshold value that is used with the `comparator`.
If the `comparator` is `between`, you must specify the boundary values.
comparator:
type: string
enum:
@ -21,14 +24,30 @@ properties:
- ">="
- "between"
- "outside"
description: >
The comparison function for the threshold.
For example, "is above", "is above or equals", "is below", "is below or equals", "is between", and "outside".
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: >
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: >
The size of the time window (in `timeUnit` units), which determines how far back to search for documents.
Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
type: number
description: >
The threshold value that is used with the `warningComparator`.
If the `warningComparator` is `between`, you must specify the boundary values.
warningComparator:
type: string
enum:
@ -53,7 +72,6 @@ properties:
- "p95"
- "p99"
- "custom"
- title: count criterion
type: object
properties:
@ -72,8 +90,18 @@ properties:
- "outside"
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: >
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: >
The size of the time window (in `timeUnit` units), which determines how far back to search for documents.
Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
@ -110,8 +138,18 @@ properties:
- "outside"
timeUnit:
type: string
enum:
- s
- m
- h
- d
description: >
The type of units for the time window: seconds, minutes, hours, or days.
timeSize:
type: number
description: >
The size of the time window (in `timeUnit` units), which determines how far back to search for documents.
Generally it should be a value higher than the rule check interval to avoid gaps in detection.
warningThreshold:
type: array
items:
@ -145,6 +183,10 @@ properties:
- "max"
- "min"
- "cardinality"
description: >
An aggregation to gather data for the rule.
For example, find the average, highest or lowest value of a numeric field.
Or use a cardinality aggregation to find the approximate number of unique values in a field.
field:
type: string
- type: object
@ -167,11 +209,24 @@ properties:
- type: array
items:
type: string
description: >
Create an alert for every unique value of the specified fields.
For example, you can create a rule per host or every mount point of each host.
IMPORTANT: If you include the same field in both the `filterQuery` and `groupBy`, you might receive fewer results than you expect.
For example, if you filter by `cloud.region: us-east`, grouping by `cloud.region` will have no effect because the filter query can match only one region.
filterQuery:
type: string
description: >
A query that limits the scope of the rule.
The rule evaluates only metric data that matches the query.
sourceId:
type: string
alertOnNoData:
type: boolean
description: If true, an alert occurs if the metrics do not report any data over the expected period or if the query fails.
alertOnGroupDisappear:
type: boolean
type: boolean
description: >
If true, an alert occurs if a group that previously reported metrics does not report them again over the expected time period.
This check is not recommended for dynamically scaling infrastructures that might rapidly start and stop nodes automatically.