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

This commit is contained in:
Lisa Cawley 2025-05-29 20:37:57 -07:00 committed by GitHub
parent f021985373
commit 22b9669d34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 198 additions and 9 deletions

View file

@ -73015,6 +73015,8 @@ components:
type: array type: array
items: items:
type: number type: number
description: |
The threshold value that is used with the `comparator`. If the `comparator` is `between`, you must specify the boundary values.
comparator: comparator:
type: string type: string
enum: enum:
@ -73024,14 +73026,27 @@ components:
- '>=' - '>='
- between - between
- outside - 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: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
type: number type: number
description: |
The threshold value that is used with the `warningComparator`. If the `warningComparator` is `between`, you must specify the boundary values.
warningComparator: warningComparator:
type: string type: string
enum: enum:
@ -73074,8 +73089,17 @@ components:
- outside - outside
timeUnit: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
@ -73111,8 +73135,17 @@ components:
- outside - outside
timeUnit: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
@ -73146,6 +73179,8 @@ components:
- max - max
- min - min
- cardinality - 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: field:
type: string type: string
- type: object - type: object
@ -73168,14 +73203,22 @@ components:
- type: array - type: array
items: items:
type: string 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: filterQuery:
type: string type: string
description: |
A query that limits the scope of the rule. The rule evaluates only metric data that matches the query.
sourceId: sourceId:
type: string type: string
alertOnNoData: alertOnNoData:
type: boolean 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: 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.
params_property_slo_burn_rate: params_property_slo_burn_rate:
properties: properties:
sloId: sloId:

View file

@ -82922,6 +82922,8 @@ components:
type: array type: array
items: items:
type: number type: number
description: |
The threshold value that is used with the `comparator`. If the `comparator` is `between`, you must specify the boundary values.
comparator: comparator:
type: string type: string
enum: enum:
@ -82931,14 +82933,27 @@ components:
- '>=' - '>='
- between - between
- outside - 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: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
type: number type: number
description: |
The threshold value that is used with the `warningComparator`. If the `warningComparator` is `between`, you must specify the boundary values.
warningComparator: warningComparator:
type: string type: string
enum: enum:
@ -82981,8 +82996,17 @@ components:
- outside - outside
timeUnit: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
@ -83018,8 +83042,17 @@ components:
- outside - outside
timeUnit: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: |
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
@ -83053,6 +83086,8 @@ components:
- max - max
- min - min
- cardinality - 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: field:
type: string type: string
- type: object - type: object
@ -83075,14 +83110,22 @@ components:
- type: array - type: array
items: items:
type: string 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: filterQuery:
type: string type: string
description: |
A query that limits the scope of the rule. The rule evaluates only metric data that matches the query.
sourceId: sourceId:
type: string type: string
alertOnNoData: alertOnNoData:
type: boolean 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: 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.
params_property_slo_burn_rate: params_property_slo_burn_rate:
properties: properties:
sloId: sloId:

View file

@ -32,11 +32,34 @@ const METRIC_EXPLORER_AGGREGATIONS = [
const comparator = Object.values({ ...COMPARATORS, ...LEGACY_COMPARATORS }); const comparator = Object.values({ ...COMPARATORS, ...LEGACY_COMPARATORS });
const baseCriterion = { 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), comparator: oneOfLiterals(comparator),
timeUnit: schema.string(), timeUnit: schema.string({
timeSize: schema.number(), meta: {
warningThreshold: schema.maybe(schema.arrayOf(schema.number())), 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)), warningComparator: schema.maybe(oneOfLiterals(comparator)),
}; };
@ -85,15 +108,40 @@ const customCriterion = schema.object({
export const metricThresholdRuleParamsSchema = schema.object( export const metricThresholdRuleParamsSchema = schema.object(
{ {
criteria: schema.arrayOf(schema.oneOf([countCriterion, nonCountCriterion, customCriterion])), 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( filterQuery: schema.maybe(
schema.string({ schema.string({
validate: validateIsStringElasticsearchJSONFilter, 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(), sourceId: schema.string(),
alertOnNoData: schema.maybe(schema.boolean()), alertOnNoData: schema.maybe(
alertOnGroupDisappear: schema.maybe(schema.boolean()), 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' } { unknowns: 'allow' }
); );

View file

@ -12,6 +12,9 @@ properties:
type: array type: array
items: items:
type: number type: number
description: >
The threshold value that is used with the `comparator`.
If the `comparator` is `between`, you must specify the boundary values.
comparator: comparator:
type: string type: string
enum: enum:
@ -21,14 +24,30 @@ properties:
- ">=" - ">="
- "between" - "between"
- "outside" - "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: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: >
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
type: number type: number
description: >
The threshold value that is used with the `warningComparator`.
If the `warningComparator` is `between`, you must specify the boundary values.
warningComparator: warningComparator:
type: string type: string
enum: enum:
@ -53,7 +72,6 @@ properties:
- "p95" - "p95"
- "p99" - "p99"
- "custom" - "custom"
- title: count criterion - title: count criterion
type: object type: object
properties: properties:
@ -72,8 +90,18 @@ properties:
- "outside" - "outside"
timeUnit: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: >
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
@ -110,8 +138,18 @@ properties:
- "outside" - "outside"
timeUnit: timeUnit:
type: string type: string
enum:
- s
- m
- h
- d
description: >
The type of units for the time window: seconds, minutes, hours, or days.
timeSize: timeSize:
type: number 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: warningThreshold:
type: array type: array
items: items:
@ -145,6 +183,10 @@ properties:
- "max" - "max"
- "min" - "min"
- "cardinality" - "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: field:
type: string type: string
- type: object - type: object
@ -167,11 +209,24 @@ properties:
- type: array - type: array
items: items:
type: string 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: filterQuery:
type: string type: string
description: >
A query that limits the scope of the rule.
The rule evaluates only metric data that matches the query.
sourceId: sourceId:
type: string type: string
alertOnNoData: alertOnNoData:
type: boolean 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: 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.