Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/8.x' into backport/8.x/pr-198000
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Dec 5, 2024
2 parents 835b6f7 + 59883db commit 5e908a8
Show file tree
Hide file tree
Showing 508 changed files with 9,647 additions and 4,558 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ packages/kbn-resizable-layout @elastic/kibana-data-discovery
examples/resizable_layout_examples @elastic/kibana-data-discovery
x-pack/test/plugin_functional/plugins/resolver_test @elastic/security-solution
packages/response-ops/feature_flag_service @elastic/response-ops
packages/response-ops/rule_form @elastic/response-ops
packages/response-ops/rule_params @elastic/response-ops
examples/response_stream @elastic/ml-ui
packages/kbn-rison @elastic/kibana-operations
Expand Down
5 changes: 3 additions & 2 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"searchTypes": "packages/kbn-search-types",
"securitySolutionPackages": "x-pack/packages/security-solution",
"serverlessPackages": "packages/serverless",
"sse": [ "packages/kbn-sse-utils" ],
"sse": ["packages/kbn-sse-utils"],
"coloring": "packages/kbn-coloring/src",
"languageDocumentation": "packages/kbn-language-documentation/src",
"esql": "src/plugins/esql",
Expand Down Expand Up @@ -154,7 +154,8 @@
"unifiedDataTable": "packages/kbn-unified-data-table",
"unsavedChangesBadge": "packages/kbn-unsaved-changes-badge",
"unsavedChangesPrompt": "packages/kbn-unsaved-changes-prompt",
"managedContentBadge": "packages/kbn-managed-content-badge"
"managedContentBadge": "packages/kbn-managed-content-badge",
"responseOpsRuleForm": "packages/response-ops/rule_form"
},
"translations": []
}
16 changes: 10 additions & 6 deletions docs/user/alerting/create-and-manage-rules.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@
The *{stack-manage-app}* > *{rules-ui}* UI provides a cross-app view of alerting.
Different {kib} apps like {observability-guide}/create-alerts.html[*{observability}*],
{security-guide}/prebuilt-rules.html[*Security*], <<geo-alerting,*Maps*>> and
<<xpack-ml,*{ml-app}*>> can offer their own rules. *{rules-ui}* provides a
<<xpack-ml,*{ml-app}*>> can offer their own rules.

You can find **Rules** in *Stack Management* > *Alerts and insights* > *Rules* in {kib} or by using
the <<kibana-navigation-search,global search field>>.

[role="screenshot"]
image:images/stack-management-rules.png[Rules page navigation]

*{rules-ui}* provides a
central place to:

* <<create-edit-rules,Create and edit>> rules
* <<controlling-rules,Manage rules>> including enabling/disabling, muting/unmuting, and deleting
* Drill down to <<rule-details,rule details>>
* Configure settings that apply to all rules in the space

[role="screenshot"]
image:images/rules-ui.png[Example rule listing in {rules-ui}]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
* Configure rule settings

For more information on alerting concepts and the types of rules and connectors
available, go to <<alerting-getting-started>>.
Expand Down
Binary file added docs/user/images/stack-management-rules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions oas_docs/kibana.info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ info:
x-feedbackLink:
label: Feedback
url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+
servers:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
security:
- apiKeyAuth: []
- basicAuth: []
Expand Down
11 changes: 11 additions & 0 deletions oas_docs/overlays/kibana.overlays.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ info:
title: Overlays for the Kibana API document
version: 0.0.1
actions:
# Clean up server definitions
- target: '$.servers.*'
description: Remove all servers so we can add our own.
remove: true
- target: '$.servers'
description: Add server into the now empty server array.
update:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
# Add an introduction to spaces
- target: '$'
description: Add an extra page about spaces
Expand Down
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@types/react": "~18.2.0",
"@types/react-dom": "~18.2.0",
"@xstate5/react/**/xstate": "^5.18.1",
"globby/fast-glob": "^3.2.11"
"globby/fast-glob": "^3.3.2"
},
"dependencies": {
"@appland/sql-parser": "^1.5.1",
Expand Down Expand Up @@ -757,6 +757,7 @@
"@kbn/resizable-layout-examples-plugin": "link:examples/resizable_layout_examples",
"@kbn/resolver-test-plugin": "link:x-pack/test/plugin_functional/plugins/resolver_test",
"@kbn/response-ops-feature-flag-service": "link:packages/response-ops/feature_flag_service",
"@kbn/response-ops-rule-form": "link:packages/response-ops/rule_form",
"@kbn/response-ops-rule-params": "link:packages/response-ops/rule_params",
"@kbn/response-stream-plugin": "link:examples/response_stream",
"@kbn/rison": "link:packages/kbn-rison",
Expand Down Expand Up @@ -1029,7 +1030,7 @@
"@langchain/google-vertexai": "^0.1.0",
"@langchain/langgraph": "0.2.19",
"@langchain/openai": "^0.3.11",
"@langtrase/trace-attributes": "^3.0.8",
"@langtrase/trace-attributes": "^7.5.0",
"@launchdarkly/node-server-sdk": "^9.7.2",
"@launchdarkly/openfeature-node-server": "^1.0.0",
"@loaders.gl/core": "^3.4.7",
Expand All @@ -1056,12 +1057,12 @@
"@reduxjs/toolkit": "1.9.7",
"@slack/webhook": "^7.0.1",
"@smithy/eventstream-codec": "^3.1.1",
"@smithy/eventstream-serde-node": "^3.0.3",
"@smithy/eventstream-serde-node": "^3.0.12",
"@smithy/middleware-stack": "^3.0.10",
"@smithy/node-http-handler": "^3.3.1",
"@smithy/protocol-http": "^4.1.7",
"@smithy/signature-v4": "^3.1.1",
"@smithy/types": "^3.2.0",
"@smithy/signature-v4": "^4.2.3",
"@smithy/types": "^3.7.1",
"@smithy/util-utf8": "^3.0.0",
"@tanstack/react-query": "^4.29.12",
"@tanstack/react-query-devtools": "^4.29.12",
Expand All @@ -1080,12 +1081,12 @@
"@xyflow/react": "^12.3.2",
"adm-zip": "^0.5.9",
"ai": "^2.2.33",
"ajv": "^8.12.0",
"ansi-regex": "^6.0.1",
"ajv": "^8.17.1",
"ansi-regex": "^6.1.0",
"antlr4": "^4.13.1-patch-1",
"archiver": "^7.0.1",
"async": "^3.2.3",
"aws4": "^1.12.0",
"aws4": "^1.13.2",
"axios": "^1.7.4",
"base64-js": "^1.3.1",
"bitmap-sdf": "^1.0.3",
Expand Down Expand Up @@ -1128,7 +1129,7 @@
"dotenv": "^16.4.5",
"elastic-apm-node": "^4.7.3",
"email-addresses": "^5.0.0",
"eventsource-parser": "^1.1.1",
"eventsource-parser": "^3.0.0",
"execa": "^5.1.1",
"expiry-js": "0.1.7",
"exponential-backoff": "^3.1.1",
Expand All @@ -1146,7 +1147,7 @@
"getos": "^3.1.0",
"globby": "^11.1.0",
"google-auth-library": "^9.10.0",
"gpt-tokenizer": "^2.1.2",
"gpt-tokenizer": "^2.6.2",
"handlebars": "4.7.8",
"he": "^1.2.0",
"history": "^4.9.0",
Expand Down Expand Up @@ -1174,7 +1175,7 @@
"jsts": "^1.6.2",
"kea": "^2.6.0",
"langchain": "^0.3.5",
"langsmith": "^0.2.3",
"langsmith": "^0.2.5",
"launchdarkly-js-client-sdk": "^3.5.0",
"load-json-file": "^6.2.0",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -1203,7 +1204,7 @@
"nunjucks": "^3.2.4",
"object-hash": "^1.3.1",
"object-path-immutable": "^3.1.1",
"openai": "^4.68.0",
"openai": "^4.72.0",
"openpgp": "5.10.1",
"opn": "^5.5.0",
"ora": "^4.0.4",
Expand Down Expand Up @@ -1514,7 +1515,7 @@
"@mswjs/http-middleware": "^0.10.1",
"@octokit/rest": "^17.11.2",
"@parcel/watcher": "^2.1.0",
"@playwright/test": "=1.46.0",
"@playwright/test": "1.49.0",
"@redocly/cli": "^1.25.14",
"@statoscope/webpack-plugin": "^5.28.2",
"@storybook/addon-a11y": "^6.5.16",
Expand Down Expand Up @@ -1591,7 +1592,7 @@
"@types/js-search": "^1.4.0",
"@types/js-yaml": "^3.11.1",
"@types/jsdom": "^20.0.1",
"@types/json-schema": "^7",
"@types/json-schema": "^7.0.15",
"@types/json-stable-stringify": "^1.0.32",
"@types/json5": "^2.2.0",
"@types/jsonwebtoken": "^9.0.0",
Expand Down Expand Up @@ -1802,8 +1803,8 @@
"pirates": "^4.0.1",
"piscina": "^3.2.0",
"pixelmatch": "^5.3.0",
"playwright": "=1.46.0",
"playwright-chromium": "=1.46.0",
"playwright": "1.49.0",
"playwright-chromium": "1.49.0",
"pngjs": "^3.4.0",
"postcss": "^8.4.31",
"postcss-loader": "^4.2.0",
Expand Down Expand Up @@ -1835,7 +1836,7 @@
"svgo": "^2.8.0",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
"table": "^6.8.1",
"table": "^6.8.2",
"tape": "^5.0.1",
"terser": "^5.31.6",
"terser-webpack-plugin": "^4.2.3",
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-alerts-ui-shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ export type { AlertsSearchBarProps } from './src/alerts_search_bar/types';
export * from './src/alert_fields_table';
export * from './src/alert_filter_controls/types';
export * from './src/common/types';
export * from './src/check_action_type_enabled';
export * from './src/action_variables';

export { useFetchFlappingSettings } from './src/common/hooks/use_fetch_flapping_settings';
1 change: 1 addition & 0 deletions packages/kbn-alerts-ui-shared/lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Export files in here that are only meant to be used by other KBN packages and not directly imported by plugins. This helps to keep bundle sizes efficient.
11 changes: 11 additions & 0 deletions packages/kbn-alerts-ui-shared/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export * from '../src/common/type_registry';
export * from '../src/rule_settings';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { ActionVariables, RuleType } from '@kbn/triggers-actions-ui-types';
import { transformActionVariables } from './transforms';
import { ALERTING_FEATURE_ID } from '../rule_form';
import { ALERTING_FEATURE_ID } from '../common/constants';

beforeEach(() => jest.resetAllMocks());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
*/

import { ActionType } from '@kbn/actions-types';
import { PreConfiguredActionConnector } from '../common/types';
import {
checkActionTypeEnabled,
checkActionFormActionTypeEnabled,
checkActionTypeEnabled,
} from './check_action_type_enabled';
import { PreConfiguredActionConnector } from '../../common';

describe('checkActionTypeEnabled', () => {
test(`returns isEnabled:true when action type isn't provided`, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/

import { ActionType } from '@kbn/actions-types';
import { configurationCheckResult, getLicenseCheckResult } from './get_license_check_result';
import { ActionConnector } from '../../common';
import { ActionConnector } from '../common/types';
import './check_action_type_enabled.scss';
import { configurationCheckResult, getLicenseCheckResult } from './get_license_check_result';

export interface IsEnabledResult {
isEnabled: true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { i18n } from '@kbn/i18n';
import { EuiCard, EuiLink } from '@elastic/eui';
import { ActionType } from '@kbn/actions-types';
import { FormattedMessage } from '@kbn/i18n-react';
import { VIEW_LICENSE_OPTIONS_LINK } from '../../common/constants';
import { VIEW_LICENSE_OPTIONS_LINK } from '../common/constants';

export const getLicenseCheckResult = (actionType: ActionType) => {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export * from './check_action_type_enabled';
7 changes: 2 additions & 5 deletions packages/kbn-alerts-ui-shared/src/common/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export * from './create_rule';
export * from './fetch_alerting_framework_health';
export * from './fetch_alerts_fields';
export * from './fetch_connector_types';
export * from './fetch_alerts_index_names';
export * from './fetch_connectors';
export * from './fetch_connector_types';
export * from './fetch_rule_type_aad_template_fields';
export * from './fetch_ui_config';
export * from './fetch_ui_health_status';
export * from './resolve_rule';
export * from './update_rule';
2 changes: 2 additions & 0 deletions packages/kbn-alerts-ui-shared/src/common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ export * from './i18n_weekdays';
export * from './routes';

export const VIEW_LICENSE_OPTIONS_LINK = 'https://www.elastic.co/subscriptions';

export const ALERTING_FEATURE_ID = 'alerts';
8 changes: 0 additions & 8 deletions packages/kbn-alerts-ui-shared/src/common/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@
*/

export * from './use_alerts_data_view';
export * from './use_create_rule';
export * from './use_update_rule';
export * from './use_resolve_rule';
export * from './use_load_connectors';
export * from './use_load_connector_types';
export * from './use_get_alerts_group_aggregations_query';
export * from './use_health_check';
export * from './use_load_alerting_framework_health';
export * from './use_load_rule_types_query';
export * from './use_load_ui_config';
export * from './use_load_ui_health';
export * from './use_resolve_rule';
export * from './use_update_rule';
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import { fetchAlertsFields, FetchAlertsFieldsParams } from '../apis/fetch_alerts

export type UseFetchAlertsFieldsQueryParams = FetchAlertsFieldsParams;

export const queryKeyPrefix = ['alerts', fetchAlertsFields.name];
// Query key prefix MUST contain explicit strings, not fetchAlertsFields.name
// Production builds cannot guarantee a unique function name
export const queryKeyPrefix = ['alerts', 'fetchAlertsFields'];

/**
* Fetch alerts indexes browser fields for the given feature ids
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import type { QueryOptionsOverrides } from '../types/tanstack_query_utility_type

export type UseFetchAlertsIndexNamesQueryParams = FetchAlertsIndexNamesParams;

export const queryKeyPrefix = ['alerts', fetchAlertsIndexNames.name];
// Query key prefix MUST contain explicit strings, not fetchAlertsIndexNames.name
// Production builds cannot guarantee a unique function name
export const queryKeyPrefix = ['alerts', 'fetchAlertsIndexNames'];

/**
* Fetch alerts index names feature ids
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { useQuery } from '@tanstack/react-query';
import { HttpStart } from '@kbn/core-http-browser';
import type { HttpStart } from '@kbn/core-http-browser';
import { RulesSettingsFlapping } from '@kbn/alerting-types/rule_settings';
import { fetchFlappingSettings } from '../apis/fetch_flapping_settings';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { keyBy } from 'lodash';
import { i18n } from '@kbn/i18n';
import { useMemo } from 'react';
import { useQuery } from '@tanstack/react-query';
import type { HttpStart } from '@kbn/core-http-browser';
import type { ToastsStart } from '@kbn/core-notifications-browser';
import { i18n } from '@kbn/i18n';
import type { RuleType } from '@kbn/triggers-actions-ui-types';
import { ALERTS_FEATURE_ID } from '../constants';
import {
RuleTypeIndexWithDescriptions,
RuleTypeWithDescription,
} from '@kbn/triggers-actions-ui-types';
import { useQuery } from '@tanstack/react-query';
import { keyBy } from 'lodash';
import { useMemo } from 'react';
import { fetchRuleTypes } from '../apis/fetch_rule_types';
import { RuleTypeIndexWithDescriptions, RuleTypeWithDescription } from '../types';
import { ALERTS_FEATURE_ID } from '../constants';

export interface UseRuleTypesProps {
http: HttpStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
*/

export * from './transform_action';
export * from './transform_rule';
Loading

0 comments on commit 5e908a8

Please sign in to comment.