Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
80b48fa
Add aggregated ap status
nkhristinin Nov 11, 2025
ceb9efb
Changes from yarn openapi:bundle
kibanamachine Nov 11, 2025
fa4df71
fix ci
nkhristinin Nov 11, 2025
14d3aa1
Changes from make api-docs
kibanamachine Nov 11, 2025
2563e6d
add aggregated status in query
nkhristinin Nov 12, 2025
ae8957a
fix tests
nkhristinin Nov 12, 2025
c2875a8
add persistence logic
nkhristinin Nov 12, 2025
e855c2c
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Nov 12, 2025
45be9ce
fix tests
nkhristinin Nov 12, 2025
7487c87
return aggs names
nkhristinin Nov 13, 2025
866502b
clean up
nkhristinin Nov 13, 2025
fff6356
fix open api
nkhristinin Nov 13, 2025
9bd2edd
clean up
nkhristinin Nov 13, 2025
ac40100
Changes from yarn openapi:bundle
kibanamachine Nov 13, 2025
ba4dac0
Changes from make api-docs
kibanamachine Nov 13, 2025
7823b31
Merge branch 'main' into rules-with-gap-status
elasticmachine Nov 14, 2025
b298b8f
fix tests
nkhristinin Nov 14, 2025
161fce4
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Nov 14, 2025
ea6761d
Merge branch 'main' into rules-with-gap-status
elasticmachine Nov 18, 2025
7fea0ee
make 90 days default gap range
nkhristinin Nov 19, 2025
781f918
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Nov 19, 2025
cc5d324
Change in DE aggregated gap status to gap fill status
nkhristinin Nov 20, 2025
56f8f33
Rename to GapFillStatus
nkhristinin Nov 20, 2025
58a564c
Changes from yarn openapi:bundle
kibanamachine Nov 20, 2025
5ef908e
Changes from make api-docs
kibanamachine Nov 20, 2025
d6acab4
Rename to highest priority gap gill status
nkhristinin Nov 20, 2025
db21de9
Merge branch 'main' into rules-with-gap-status
elasticmachine Nov 20, 2025
d023c10
Rename to gap fill status in response
nkhristinin Nov 20, 2025
f20f19e
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Nov 20, 2025
4bf14ea
Add comments for statuses
nkhristinin Nov 21, 2025
5d0d8d4
Split unit tests
nkhristinin Nov 21, 2025
40fa19b
Derrive GapDurationBucket from RULE_GAP_AGGREGATIONS
nkhristinin Nov 21, 2025
db3ca63
Set default value for highestPriorityGapFillStatuses
nkhristinin Nov 21, 2025
323160a
Remove default undefined value
nkhristinin Nov 21, 2025
9010034
Extract hasMatchedGapFillStatus to utils function
nkhristinin Nov 21, 2025
2d9a134
Use common types for aggregations
nkhristinin Nov 21, 2025
ab090dc
Don't use empty string by deafult for gap_fill_status
nkhristinin Nov 21, 2025
2b777c7
Use use boolean
nkhristinin Nov 21, 2025
806f4c1
Use a common tyoe for gap fill status column
nkhristinin Nov 21, 2025
7ac3e51
Extract gap fill status tooltip into different component
nkhristinin Nov 21, 2025
1af566f
Align validation
nkhristinin Nov 21, 2025
595db05
Extract gap params to another function, to remove complexity
nkhristinin Nov 21, 2025
03800ec
fix tests
nkhristinin Nov 21, 2025
e7aeac4
use common enum for gap fill status
nkhristinin Nov 21, 2025
b9b2790
fix tests
nkhristinin Nov 21, 2025
176cce6
Merge branch 'main' into rules-with-gap-status
maximpn Nov 24, 2025
0a3eec8
reset gap fill status filter and not store in URL
nkhristinin Dec 3, 2025
c834619
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Dec 3, 2025
266ca48
Merge branch 'main' into rules-with-gap-status
nkhristinin Dec 3, 2025
e01520d
Update x-pack/solutions/security/plugins/security_solution/public/det…
nkhristinin Dec 3, 2025
4d67f8b
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Dec 3, 2025
9d8cdca
renamame function
nkhristinin Dec 3, 2025
cdce191
Move utils to to common folder
nkhristinin Dec 3, 2025
099b792
Change docs description
nkhristinin Dec 3, 2025
82062ee
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Dec 3, 2025
d6ec8ed
Changes from yarn openapi:bundle
kibanamachine Dec 3, 2025
7747db4
Changes from make api-docs
kibanamachine Dec 3, 2025
15167f5
avoid unecessary filter change
nkhristinin Dec 4, 2025
651f2b9
Merge branch 'main' into rules-with-gap-status
maximpn Dec 4, 2025
f091826
Merge branch 'main' into rules-with-gap-status
elasticmachine Dec 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14146,6 +14146,14 @@ paths:
required: false
schema:
type: string
- description: Aggregated gap fill statuses

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need help understanding the description. Can you explain in a different way what the gap_fill_statuses returns?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Represents the status of a gap fill process for a rule.
This is a derived, per-rule aggregation that summarises how well the set of gaps for a rule has been filled. It is calculated from the gap duration sums with priority: unfilled > in_progress > filled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per my other comment I don't think "Aggregated" is a helpful enough adjective, here: I would suggest using "An array of [description of single gap_fill_status]"

@nastasha-solomon nastasha-solomon Dec 2, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still having trouble understanding what the gap_fill_statuses param actually queries and what (if any) values users can specify. The "aggregated gap status" term is still unclear to me, along with the explanation of it in the PR description. A demo of the corresponding UI element (if there is one) would be really helpful here. A sample response for this param would be helpful too.

If the gap_fill_statuses param is meant to retrieve a summary of the gap statuses that you specify (e.g., Filled, In progress, and Unfilled), perhaps the following revision would work:

Array containing statuses that are used to indicate the states of gaps that have been reported for a rule. The values must be: Filled, In progress, and Unfilled

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still having trouble understanding what the gap_fill_statuses param actually queries and what (if any) values users can specify.

it used to filter rules by the gap_fill_statuses

"aggregated gap status" - not used anymore, and we have gap fill status only.

A demo of the corresponding UI

On the screenshot there gap fill status filter.

If the gap_fill_statuses param is meant to retrieve a summary of the gap statuses that you specify

it's not for retrieve summary, it's only for filter rules.

in: query
name: gap_fill_statuses
required: false
schema:
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
responses:
'200':
content:
Expand Down Expand Up @@ -79648,6 +79656,11 @@ components:
enum:
- delete
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what to suggest for this yet because I need more background on the "aggregated gap fill statuses" phrase. I'm also not clear on what the text in the parenthesis is actually communicating. Are the returned results somehow affected by when gaps start and end for the specified rules?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not clear on what the text in the parenthesis is actually communicating. Are the returned results somehow affected by when gaps start and end for the specified rules?

That this params used together with gaps_range_start and gaps_range_end param. We use this range to query gaps. Maybe we want for last day, last week, etc. In UI by default we use last 90 days

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkhristinin @nastasha-solomon how about something like:

Suggested change
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
description: The highest priority status of the gap fills in question. Priority is `unfilled > in_progress > filled`. Used to filter rules to those with a particular gap fill status.

items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand All @@ -79674,6 +79687,11 @@ components:
enum:
- disable
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -79713,6 +79731,11 @@ components:
required:
- include_exceptions
- include_expired_exceptions
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -79813,6 +79836,11 @@ components:
$ref: '#/components/schemas/Security_Detections_API_BulkActionEditPayload'
minItems: 1
type: array
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -79844,6 +79872,11 @@ components:
enum:
- enable
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -79872,6 +79905,11 @@ components:
enum:
- export
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -79915,6 +79953,11 @@ components:
required:
- start_date
- end_date
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -79942,6 +79985,11 @@ components:
enum:
- run
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -81110,6 +81158,12 @@ components:
- updated_at
- updatedAt
type: string
Security_Detections_API_GapFillStatus:
enum:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add an accompanying description field that describes what these values mean, for clarity:

Suggested change
enum:
description: A gap fill can either be unfilled, in the process of being filled, or filled.
enum:

- unfilled
- in_progress
- filled
type: string
Security_Detections_API_HistoryWindowStart:
description: Start date to use when checking if a term has been seen before. Supports relative dates – for example, now-30d will search the last 30 days of data when checking if a term is new. We do not recommend using absolute dates, which can cause issues with rule performance due to querying increasing amounts of data over time.
format: nonempty
Expand Down
54 changes: 54 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16071,6 +16071,14 @@ paths:
required: false
schema:
type: string
- description: Aggregated gap fill statuses
in: query
name: gap_fill_statuses
required: false
schema:
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
responses:
'200':
content:
Expand Down Expand Up @@ -90195,6 +90203,11 @@ components:
enum:
- delete
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand All @@ -90221,6 +90234,11 @@ components:
enum:
- disable
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -90260,6 +90278,11 @@ components:
required:
- include_exceptions
- include_expired_exceptions
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -90360,6 +90383,11 @@ components:
$ref: '#/components/schemas/Security_Detections_API_BulkActionEditPayload'
minItems: 1
type: array
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -90391,6 +90419,11 @@ components:
enum:
- enable
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -90419,6 +90452,11 @@ components:
enum:
- export
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -90462,6 +90500,11 @@ components:
required:
- start_date
- end_date
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -90489,6 +90532,11 @@ components:
enum:
- run
type: string
gap_fill_statuses:
description: Aggregated gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -91657,6 +91705,12 @@ components:
- updated_at
- updatedAt
type: string
Security_Detections_API_GapFillStatus:
enum:
- unfilled
- in_progress
- filled
type: string
Security_Detections_API_HistoryWindowStart:
description: Start date to use when checking if a term has been seen before. Supports relative dates – for example, now-30d will search the last 30 days of data when checking if a term is new. We do not recommend using absolute dates, which can cause issues with rule performance due to querying increasing amounts of data over time.
format: nonempty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38468,11 +38468,6 @@
"xpack.securitySolution.ruleExceptions.logic.closeAlerts.error": "Alerts konnten nicht geschlossen werden",
"xpack.securitySolution.ruleFromTimeline.error.title": "Regel konnte nicht aus der Zeitleiste importiert werden",
"xpack.securitySolution.ruleFromTimeline.error.toastMessage": "Fehler beim Erstellen einer Regel aus der Zeitachse mit der ID: {id}",
"xpack.securitySolution.ruleGapsOverviewPanel.label": "Gesamtanzahl der Regeln mit Lücken:",
"xpack.securitySolution.ruleGapsOverviewPanel.last24HoursLabel": "Letzte 24 Stunden",
"xpack.securitySolution.ruleGapsOverviewPanel.last3DaysLabel": "Letzte 3 Tage",
"xpack.securitySolution.ruleGapsOverviewPanel.last7DaysLabel": "Letzte 7 Tage",
"xpack.securitySolution.ruleGapsOverviewPanel.showRulesWithGapsLabel": "Nur Regeln mit Lücken",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipContent": "Sehen Sie sich unser {createEsqlRuleTypeLink} an, um mit der Nutzung der ES|QL-Regeln zu beginnen.",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipLink": "Dokumentation",
"xpack.securitySolution.ruleManagement.esqlValidation.errorMessage": "Fehler bei der Validierung von ES|QL: \"{message}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38784,11 +38784,6 @@
"xpack.securitySolution.ruleExceptions.logic.closeAlerts.success": "Mise à jour réussie de {numAlerts} {numAlerts, plural, =1 {alert} other {alertes}}",
"xpack.securitySolution.ruleFromTimeline.error.title": "Échec de l'importation de la règle à partir de la chronologie",
"xpack.securitySolution.ruleFromTimeline.error.toastMessage": "Impossible de créer la règle à partir de la chronologie avec l'ID : {id}",
"xpack.securitySolution.ruleGapsOverviewPanel.label": "Nombre total de règles avec des écarts :",
"xpack.securitySolution.ruleGapsOverviewPanel.last24HoursLabel": "Dernières 24 heures",
"xpack.securitySolution.ruleGapsOverviewPanel.last3DaysLabel": "3 derniers jours",
"xpack.securitySolution.ruleGapsOverviewPanel.last7DaysLabel": "7 derniers jours",
"xpack.securitySolution.ruleGapsOverviewPanel.showRulesWithGapsLabel": "Seulement les règles avec des écarts",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipContent": "Consultez {createEsqlRuleTypeLink} pour commencer à utiliser les règles ES|QL.",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipLink": "documentation",
"xpack.securitySolution.ruleManagement.esqlValidation.errorMessage": "Erreur lors de la validation ES|QL : \"{message}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38828,11 +38828,6 @@
"xpack.securitySolution.ruleExceptions.logic.closeAlerts.success": "{numAlerts} {numAlerts, plural, =1 {alert} other {件のアラート}}が正常に更新されました",
"xpack.securitySolution.ruleFromTimeline.error.title": "タイムラインからルールをインポートできませんでした",
"xpack.securitySolution.ruleFromTimeline.error.toastMessage": "次のIDでタイムラインからのルール作成に失敗しました:{id}",
"xpack.securitySolution.ruleGapsOverviewPanel.label": "ギャップがあるルールの合計数:",
"xpack.securitySolution.ruleGapsOverviewPanel.last24HoursLabel": "過去 24 時間",
"xpack.securitySolution.ruleGapsOverviewPanel.last3DaysLabel": "過去3日間",
"xpack.securitySolution.ruleGapsOverviewPanel.last7DaysLabel": "過去 7 日間",
"xpack.securitySolution.ruleGapsOverviewPanel.showRulesWithGapsLabel": "ギャップがあるルールのみ",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipContent": "ES|QL ルールの使用を開始するには、{createEsqlRuleTypeLink}を確認してください。",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipLink": "ドキュメンテーション",
"xpack.securitySolution.ruleManagement.esqlValidation.errorMessage": "ES|QLの検証エラー:\"{message}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38808,11 +38808,6 @@
"xpack.securitySolution.ruleExceptions.logic.closeAlerts.success": "已成功更新 {numAlerts} 个{numAlerts, plural, =1 {告警} other {告警}}",
"xpack.securitySolution.ruleFromTimeline.error.title": "无法从时间线导入规则",
"xpack.securitySolution.ruleFromTimeline.error.toastMessage": "无法用以下 ID 从时间线创建规则:{id}",
"xpack.securitySolution.ruleGapsOverviewPanel.label": "存在缺口的规则总数:",
"xpack.securitySolution.ruleGapsOverviewPanel.last24HoursLabel": "过去 24 小时",
"xpack.securitySolution.ruleGapsOverviewPanel.last3DaysLabel": "过去 3 天",
"xpack.securitySolution.ruleGapsOverviewPanel.last7DaysLabel": "过去 7 天",
"xpack.securitySolution.ruleGapsOverviewPanel.showRulesWithGapsLabel": "仅限存在缺口的规则",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipContent": "请访问我们的{createEsqlRuleTypeLink}以开始使用 ES|QL 规则。",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipLink": "文档",
"xpack.securitySolution.ruleManagement.esqlValidation.errorMessage": "验证 ES|QL 时出错:“{message}”",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ export const gapStatus = {
} as const;

export type GapStatus = (typeof gapStatus)[keyof typeof gapStatus];

export const gapFillStatus = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It'd be nice to have comments describing the meaning of gapStatus and gapFillStatus with links to gap definition and extra details.

UNFILLED: 'unfilled',
IN_PROGRESS: 'in_progress',
FILLED: 'filled',
} as const;

export type GapFillStatus = (typeof gapFillStatus)[keyof typeof gapFillStatus];
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export {
MAX_SCHEDULE_BACKFILL_LOOKBACK_WINDOW_MS,
} from './backfill';
export { PLUGIN } from './plugin';
export { gapStatus } from './gap_status';
export type { GapStatus } from './gap_status';
export { gapStatus, gapFillStatus } from './gap_status';
export type { GapStatus, GapFillStatus } from './gap_status';
export { alertDeleteCategoryIds } from './alert_delete';
export type { BackfillInitiator } from './backfill';
export { backfillInitiator } from './backfill';
3 changes: 2 additions & 1 deletion x-pack/platform/plugins/shared/alerting/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ export {
preconfiguredConnectorActionRefPrefix,
systemConnectorActionRefPrefix,
} from './action_ref_prefix';
export { gapStatus } from './constants';
export { gapStatus, gapFillStatus } from './constants';
export type { GapStatus, GapFillStatus } from './constants';

export type {
MaintenanceWindowModificationMetadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const getGapsSummaryByRuleIdsResponseSchema = schema.object({
total_unfilled_duration_ms: schema.number(),
total_in_progress_duration_ms: schema.number(),
total_filled_duration_ms: schema.number(),
gap_fill_status: schema.maybe(schema.string()),
})
),
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,30 @@
* 2.0.
*/
import { schema } from '@kbn/config-schema';
import { gapFillStatus, gapStatus } from '../../../../../constants';

export const getRuleIdsWithGapBodySchema = schema.object(
{
end: schema.string(),
start: schema.string(),
statuses: schema.maybe(schema.arrayOf(schema.string())),
statuses: schema.maybe(
schema.arrayOf(
schema.oneOf([
schema.literal(gapStatus.UNFILLED),
schema.literal(gapStatus.PARTIALLY_FILLED),
schema.literal(gapStatus.FILLED),
])
)
),
highest_priority_gap_fill_statuses: schema.maybe(
schema.arrayOf(
schema.oneOf([
schema.literal(gapFillStatus.UNFILLED),
schema.literal(gapFillStatus.IN_PROGRESS),
schema.literal(gapFillStatus.FILLED),
])
)
),
Comment on lines +16 to +35

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please comment ** statuses** and ** highest_priority_gap_fill_statuses**? In particular it'd be nice to a justification for naming choice. Like why highest_priority_gap_fill_statuses is used while it could be just gap_fill_statuses.

has_unfilled_intervals: schema.maybe(schema.boolean()),
has_in_progress_intervals: schema.maybe(schema.boolean()),
has_filled_intervals: schema.maybe(schema.boolean()),
Expand Down
Loading