Skip to content

Commit 649e69a

Browse files
Merge branch '7.x' into backport/7.x/pr-69626
2 parents c73ba9c + c870b85 commit 649e69a

File tree

371 files changed

+12578
-3666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

371 files changed

+12578
-3666
lines changed

.github/CODEOWNERS

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
# GitHub CODEOWNERS definition
2+
# Identify which groups will be pinged by changes to different parts of the codebase.
3+
# For more info, see https://help.github.com/articles/about-codeowners/
4+
5+
# App
6+
/x-pack/plugins/dashboard_enhanced/ @elastic/kibana-app
7+
/x-pack/plugins/discover_enhanced/ @elastic/kibana-app
8+
/x-pack/plugins/lens/ @elastic/kibana-app
9+
/x-pack/plugins/graph/ @elastic/kibana-app
10+
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
11+
/src/plugins/dashboard/ @elastic/kibana-app
12+
/src/plugins/discover/ @elastic/kibana-app
13+
/src/plugins/input_control_vis/ @elastic/kibana-app
14+
/src/plugins/kibana_legacy/ @elastic/kibana-app
15+
/src/plugins/vis_default_editor/ @elastic/kibana-app
16+
/src/plugins/vis_type_markdown/ @elastic/kibana-app
17+
/src/plugins/vis_type_metric/ @elastic/kibana-app
18+
/src/plugins/vis_type_table/ @elastic/kibana-app
19+
/src/plugins/vis_type_tagcloud/ @elastic/kibana-app
20+
/src/plugins/vis_type_timelion/ @elastic/kibana-app
21+
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
22+
/src/plugins/vis_type_vega/ @elastic/kibana-app
23+
/src/plugins/vis_type_vislib/ @elastic/kibana-app
24+
/src/plugins/vis_type_xy/ @elastic/kibana-app
25+
/src/plugins/visualize/ @elastic/kibana-app
26+
27+
# Core UI
28+
# Exclude tutorials folder for now because they are not owned by Kibana app and most will move out soon
29+
/src/plugins/home/public @elastic/kibana-core-ui
30+
/src/plugins/home/server/*.ts @elastic/kibana-core-ui
31+
/src/plugins/home/server/services/ @elastic/kibana-core-ui
32+
# Exclude tutorial resources folder for now because they are not owned by Kibana app and most will move out soon
33+
/src/legacy/core_plugins/kibana/public/home/*.ts @elastic/kibana-core-ui
34+
/src/legacy/core_plugins/kibana/public/home/*.scss @elastic/kibana-core-ui
35+
/src/legacy/core_plugins/kibana/public/home/np_ready/ @elastic/kibana-core-ui
36+
37+
# App Architecture
38+
/examples/developer_examples/ @elastic/kibana-app-arch
39+
/examples/url_generators_examples/ @elastic/kibana-app-arch
40+
/examples/url_generators_explorer/ @elastic/kibana-app-arch
41+
/packages/kbn-interpreter/ @elastic/kibana-app-arch
42+
/packages/elastic-datemath/ @elastic/kibana-app-arch
43+
/src/legacy/core_plugins/embeddable_api/ @elastic/kibana-app-arch
44+
/src/legacy/core_plugins/interpreter/ @elastic/kibana-app-arch
45+
/src/legacy/core_plugins/kibana_react/ @elastic/kibana-app-arch
46+
/src/legacy/core_plugins/kibana/public/management/ @elastic/kibana-app-arch
47+
/src/legacy/core_plugins/kibana/server/routes/api/management/ @elastic/kibana-app-arch
48+
/src/legacy/core_plugins/visualizations/ @elastic/kibana-app-arch
49+
/src/legacy/server/index_patterns/ @elastic/kibana-app-arch
50+
/src/plugins/advanced_settings/ @elastic/kibana-app-arch
51+
/src/plugins/bfetch/ @elastic/kibana-app-arch
52+
/src/plugins/data/ @elastic/kibana-app-arch
53+
/src/plugins/embeddable/ @elastic/kibana-app-arch
54+
/src/plugins/expressions/ @elastic/kibana-app-arch
55+
/src/plugins/inspector/ @elastic/kibana-app-arch
56+
/src/plugins/kibana_react/ @elastic/kibana-app-arch
57+
/src/plugins/kibana_react/public/code_editor @elastic/kibana-canvas
58+
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
59+
/src/plugins/management/ @elastic/kibana-app-arch
60+
/src/plugins/navigation/ @elastic/kibana-app-arch
61+
/src/plugins/share/ @elastic/kibana-app-arch
62+
/src/plugins/ui_actions/ @elastic/kibana-app-arch
63+
/src/plugins/visualizations/ @elastic/kibana-app-arch
64+
/x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch
65+
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-arch
66+
/x-pack/plugins/drilldowns/ @elastic/kibana-app-arch
67+
68+
# APM
69+
/x-pack/plugins/apm/ @elastic/apm-ui
70+
/x-pack/test/functional/apps/apm/ @elastic/apm-ui
71+
/src/legacy/core_plugins/apm_oss/ @elastic/apm-ui
72+
/src/plugins/apm_oss/ @elastic/apm-ui
73+
/src/apm.js @watson @vigneshshanmugam
74+
75+
# Beats
76+
/x-pack/legacy/plugins/beats_management/ @elastic/beats
77+
78+
# Canvas
79+
/x-pack/plugins/canvas/ @elastic/kibana-canvas
80+
/x-pack/test/functional/apps/canvas/ @elastic/kibana-canvas
81+
82+
# Observability UIs
83+
/x-pack/legacy/plugins/infra/ @elastic/logs-metrics-ui
84+
/x-pack/plugins/infra/ @elastic/logs-metrics-ui
85+
/x-pack/plugins/ingest_manager/ @elastic/ingest-management
86+
/x-pack/legacy/plugins/ingest_manager/ @elastic/ingest-management
87+
/x-pack/plugins/observability/ @elastic/logs-metrics-ui @elastic/apm-ui @elastic/uptime @elastic/ingest-management
88+
/x-pack/legacy/plugins/monitoring/ @elastic/stack-monitoring-ui
89+
/x-pack/plugins/monitoring/ @elastic/stack-monitoring-ui
90+
/x-pack/plugins/uptime @elastic/uptime
91+
92+
# Machine Learning
93+
/x-pack/legacy/plugins/ml/ @elastic/ml-ui
94+
/x-pack/plugins/ml/ @elastic/ml-ui
95+
/x-pack/test/functional/apps/machine_learning/ @elastic/ml-ui
96+
/x-pack/test/functional/services/machine_learning/ @elastic/ml-ui
97+
/x-pack/test/functional/services/ml.ts @elastic/ml-ui
98+
# ML team owns and maintains the transform plugin despite it living in the Elasticsearch management section.
99+
/x-pack/plugins/transform/ @elastic/ml-ui
100+
/x-pack/test/functional/apps/transform/ @elastic/ml-ui
101+
/x-pack/test/functional/services/transform_ui/ @elastic/ml-ui
102+
/x-pack/test/functional/services/transform.ts @elastic/ml-ui
103+
104+
# Maps
105+
/x-pack/legacy/plugins/maps/ @elastic/kibana-gis
106+
/x-pack/plugins/maps/ @elastic/kibana-gis
107+
/x-pack/test/api_integration/apis/maps/ @elastic/kibana-gis
108+
/x-pack/test/functional/apps/maps/ @elastic/kibana-gis
109+
/x-pack/test/functional/es_archives/maps/ @elastic/kibana-gis
110+
/x-pack/test/visual_regression/tests/maps/index.js @elastic/kibana-gis
111+
112+
# Operations
113+
/src/dev/ @elastic/kibana-operations
114+
/src/setup_node_env/ @elastic/kibana-operations
115+
/src/optimize/ @elastic/kibana-operations
116+
/src/es_archiver/ @elastic/kibana-operations
117+
/packages/*eslint*/ @elastic/kibana-operations
118+
/packages/*babel*/ @elastic/kibana-operations
119+
/packages/kbn-dev-utils*/ @elastic/kibana-operations
120+
/packages/kbn-es/ @elastic/kibana-operations
121+
/packages/kbn-optimizer/ @elastic/kibana-operations
122+
/packages/kbn-pm/ @elastic/kibana-operations
123+
/packages/kbn-test/ @elastic/kibana-operations
124+
/packages/kbn-ui-shared-deps/ @elastic/kibana-operations
125+
/src/legacy/server/keystore/ @elastic/kibana-operations
126+
/src/legacy/server/pid/ @elastic/kibana-operations
127+
/src/legacy/server/sass/ @elastic/kibana-operations
128+
/src/legacy/server/utils/ @elastic/kibana-operations
129+
/src/legacy/server/warnings/ @elastic/kibana-operations
130+
/.ci/es-snapshots/ @elastic/kibana-operations
131+
/vars/ @elastic/kibana-operations
132+
133+
# Quality Assurance
134+
/src/dev/code_coverage @elastic/kibana-qa
135+
/test/functional/services/common @elastic/kibana-qa
136+
/test/functional/services/lib @elastic/kibana-qa
137+
/test/functional/services/remote @elastic/kibana-qa
138+
139+
# Platform
140+
/src/core/ @elastic/kibana-platform
141+
/config/kibana.yml @elastic/kibana-platform
142+
/x-pack/plugins/features/ @elastic/kibana-platform
143+
/x-pack/plugins/licensing/ @elastic/kibana-platform
144+
/x-pack/plugins/global_search/ @elastic/kibana-platform
145+
/x-pack/plugins/cloud/ @elastic/kibana-platform
146+
/packages/kbn-config-schema/ @elastic/kibana-platform
147+
/src/legacy/server/config/ @elastic/kibana-platform
148+
/src/legacy/server/http/ @elastic/kibana-platform
149+
/src/legacy/server/logging/ @elastic/kibana-platform
150+
/src/legacy/server/saved_objects/ @elastic/kibana-platform
151+
/src/legacy/server/status/ @elastic/kibana-platform
152+
/src/plugins/status_page/ @elastic/kibana-platform
153+
/src/plugins/saved_objects_management/ @elastic/kibana-platform
154+
/src/dev/run_check_published_api_changes.ts @elastic/kibana-platform
155+
156+
# Security
157+
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-platform
158+
/x-pack/legacy/plugins/security/ @elastic/kibana-security
159+
/x-pack/legacy/plugins/spaces/ @elastic/kibana-security
160+
/x-pack/plugins/spaces/ @elastic/kibana-security
161+
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
162+
/x-pack/plugins/security/ @elastic/kibana-security
163+
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security
164+
165+
# Kibana Localization
166+
/src/dev/i18n/ @elastic/kibana-localization
167+
/src/legacy/server/i18n/ @elastic/kibana-localization
168+
/src/core/public/i18n/ @elastic/kibana-localization
169+
/packages/kbn-i18n/ @elastic/kibana-localization
170+
171+
# Kibana Telemetry
172+
/packages/kbn-analytics/ @elastic/kibana-telemetry
173+
/packages/kbn-telemetry-tools/ @elastic/kibana-telemetry
174+
/src/plugins/kibana_usage_collection/ @elastic/kibana-telemetry
175+
/src/plugins/newsfeed/ @elastic/kibana-telemetry
176+
/src/plugins/telemetry/ @elastic/kibana-telemetry
177+
/src/plugins/telemetry_collection_manager/ @elastic/kibana-telemetry
178+
/src/plugins/telemetry_management_section/ @elastic/kibana-telemetry
179+
/src/plugins/usage_collection/ @elastic/kibana-telemetry
180+
/x-pack/plugins/telemetry_collection_xpack/ @elastic/kibana-telemetry
181+
/.telemetryrc.json @elastic/kibana-telemetry
182+
/x-pack/.telemetryrc.json @elastic/kibana-telemetry
183+
src/plugins/telemetry/schema/legacy_oss_plugins.json @elastic/kibana-telemetry
184+
src/plugins/telemetry/schema/oss_plugins.json @elastic/kibana-telemetry
185+
x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kibana-telemetry
186+
187+
# Kibana Alerting Services
188+
/x-pack/plugins/alerts/ @elastic/kibana-alerting-services
189+
/x-pack/plugins/actions/ @elastic/kibana-alerting-services
190+
/x-pack/plugins/event_log/ @elastic/kibana-alerting-services
191+
/x-pack/plugins/task_manager/ @elastic/kibana-alerting-services
192+
/x-pack/test/alerting_api_integration/ @elastic/kibana-alerting-services
193+
/x-pack/test/plugin_api_integration/plugins/task_manager/ @elastic/kibana-alerting-services
194+
/x-pack/test/plugin_api_integration/test_suites/task_manager/ @elastic/kibana-alerting-services
195+
/x-pack/plugins/triggers_actions_ui/ @elastic/kibana-alerting-services
196+
/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/ @elastic/kibana-alerting-services
197+
/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/kibana-alerting-services
198+
199+
# Design
200+
**/*.scss @elastic/kibana-design
201+
202+
# Elasticsearch UI
203+
/src/plugins/dev_tools/ @elastic/es-ui
204+
/src/plugins/console/ @elastic/es-ui
205+
/src/plugins/es_ui_shared/ @elastic/es-ui
206+
/x-pack/legacy/plugins/cross_cluster_replication/ @elastic/es-ui
207+
/x-pack/plugins/index_lifecycle_management/ @elastic/es-ui
208+
/x-pack/legacy/plugins/index_management/ @elastic/es-ui
209+
/x-pack/legacy/plugins/license_management/ @elastic/es-ui
210+
/x-pack/legacy/plugins/rollup/ @elastic/es-ui
211+
/x-pack/legacy/plugins/snapshot_restore/ @elastic/es-ui
212+
/x-pack/legacy/plugins/upgrade_assistant/ @elastic/es-ui
213+
/x-pack/plugins/console_extensions/ @elastic/es-ui
214+
/x-pack/plugins/es_ui_shared/ @elastic/es-ui
215+
/x-pack/plugins/grokdebugger/ @elastic/es-ui
216+
/x-pack/plugins/index_management/ @elastic/es-ui
217+
/x-pack/plugins/license_management/ @elastic/es-ui
218+
/x-pack/plugins/painless_lab/ @elastic/es-ui
219+
/x-pack/plugins/remote_clusters/ @elastic/es-ui
220+
/x-pack/plugins/rollup/ @elastic/es-ui
221+
/x-pack/plugins/searchprofiler/ @elastic/es-ui
222+
/x-pack/plugins/snapshot_restore/ @elastic/es-ui
223+
/x-pack/plugins/upgrade_assistant/ @elastic/es-ui
224+
/x-pack/plugins/watcher/ @elastic/es-ui
225+
/x-pack/plugins/ingest_pipelines/ @elastic/es-ui
226+
227+
# Endpoint
228+
/x-pack/plugins/endpoint/ @elastic/endpoint-app-team @elastic/siem
229+
/x-pack/test/api_integration/apis/endpoint/ @elastic/endpoint-app-team @elastic/siem
230+
/x-pack/test/endpoint_api_integration_no_ingest/ @elastic/endpoint-app-team @elastic/siem
231+
/x-pack/test/security_solution_endpoint/ @elastic/endpoint-app-team @elastic/siem
232+
/x-pack/test/functional/es_archives/endpoint/ @elastic/endpoint-app-team @elastic/siem
233+
/x-pack/test/plugin_functional/plugins/resolver_test/ @elastic/endpoint-app-team @elastic/siem
234+
/x-pack/test/plugin_functional/test_suites/resolver/ @elastic/endpoint-app-team @elastic/siem
235+
236+
# Security Solution
237+
/x-pack/plugins/security_solution/ @elastic/siem @elastic/endpoint-app-team
238+
/x-pack/test/detection_engine_api_integration @elastic/siem @elastic/endpoint-app-team
239+
/x-pack/test/api_integration/apis/security_solution @elastic/siem @elastic/endpoint-app-team
240+
/x-pack/plugins/case @elastic/siem @elastic/endpoint-app-team
241+
/x-pack/plugins/lists @elastic/siem @elastic/endpoint-app-team
242+
243+
# Security Intelligence And Analytics
244+
/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics

.telemetryrc.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
"output": "src/plugins/telemetry/schema/legacy_oss_plugins.json",
4+
"root": "src/legacy/core_plugins/",
5+
"exclude": [
6+
"src/legacy/core_plugins/testbed",
7+
"src/legacy/core_plugins/elasticsearch",
8+
"src/legacy/core_plugins/tests_bundle"
9+
]
10+
},
11+
{
12+
"output": "src/plugins/telemetry/schema/oss_plugins.json",
13+
"root": "src/plugins/",
14+
"exclude": [
15+
"src/plugins/kibana_react/",
16+
"src/plugins/testbed/",
17+
"src/plugins/kibana_utils/",
18+
"src/plugins/kibana_usage_collection/server/collectors/kibana/kibana_usage_collector.ts",
19+
"src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts",
20+
"src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts",
21+
"src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts",
22+
"src/plugins/telemetry/server/collectors/usage/telemetry_usage_collector.ts"
23+
]
24+
}
25+
]

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
"@kbn/babel-preset": "1.0.0",
137137
"@kbn/config-schema": "1.0.0",
138138
"@kbn/i18n": "1.0.0",
139+
"@kbn/telemetry-tools": "1.0.0",
139140
"@kbn/interpreter": "1.0.0",
140141
"@kbn/pm": "1.0.0",
141142
"@kbn/test-subj-selector": "0.2.1",
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Telemetry Tools
2+
3+
## Schema extraction tool
4+
5+
### Description
6+
7+
The tool is used to extract telemetry collectors schema from all `*.{ts}` files in provided plugins directories to JSON files. The tool looks for `.telemetryrc.json` files in the root of the project and in the `x-pack` dir for its runtime configurations.
8+
9+
It uses typescript parser to build an AST for each file. The tool is able to validate, extract and match collector schemas.
10+
11+
### Examples and restrictions
12+
13+
**Global restrictions**:
14+
15+
The `id` can be only a string literal, it cannot be a template literals w/o expressions or string-only concatenation expressions or anything else.
16+
17+
```
18+
export const myCollector = makeUsageCollector<Usage>({
19+
type: 'string_literal_only',
20+
...
21+
});
22+
```
23+
24+
### Usage
25+
26+
```bash
27+
node scripts/telemetry_extract.js
28+
```
29+
30+
This command has no additional flags or arguments. The `.telemetryrc.json` files specify the path to the directory where searching should start, output json files, and files to exclude.
31+
32+
33+
### Output
34+
35+
36+
The generated JSON files contain an ES mapping for each schema. This mapping is used to verify changes in the collectors and as the basis to map those fields into the external telemetry cluster.
37+
38+
**Example**:
39+
40+
```json
41+
{
42+
"properties": {
43+
"cloud": {
44+
"properties": {
45+
"isCloudEnabled": {
46+
"type": "boolean"
47+
}
48+
}
49+
}
50+
}
51+
}
52+
```
53+
54+
## Schema validation tool
55+
56+
### Description
57+
58+
The tool performs a number of checks on all telemetry collectors and verifies the following:
59+
60+
1. Verifies the collector structure, fields, and returned values are using the appropriate types.
61+
2. Verifies that the collector `fetch` function Type matches the specified `schema` in the collector.
62+
3. Verifies that the collector `schema` matches the stored json schema .
63+
64+
### Notes
65+
66+
We don't catch every possible misuse of the collectors, but only the most common and critical ones.
67+
68+
What will not be caught by the validator:
69+
70+
* Mistyped SavedObject/CallCluster return value. Since the hits returned from ES can be typed to anything without any checks. It is advised to add functional tests that grabs the schema json file and checks that the returned usage matches the types exactly.
71+
72+
* Fields in the schema that are never collected. If you are trying to report a field from ES but that value is never stored in ES, the check will not be able to detect if that field is ever collected in the first palce. It is advised to add unit/functional tests to check that all the fields are being reported as expected.
73+
74+
The tool looks for `.telemetryrc.json` files in the root of the project and in the `x-pack` dir for its runtime configurations.
75+
76+
Currently auto-fixer (`--fix`) can automatically fix the json files with the following errors:
77+
78+
* incompatible schema - this error means that the collector schema was changed but the stored json schema file was not updated.
79+
80+
* unused schemas - this error means that a collector was removed or its `type` renamed, the json schema file contains a schema that does not have a corrisponding collector.
81+
82+
### Usage
83+
84+
```bash
85+
node scripts/telemetry_check --fix
86+
```
87+
88+
* `--path` specifies a collector path instead of checking all collectors specified in the `.telemetryrc.json` files. Accepts a `.ts` file. The file must be discoverable by at least one rc file.
89+
* `--fix` tells the tool to try to fix as many violations as possible. All errors that tool won't be able to fix will be reported.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
module.exports = {
21+
presets: ['@kbn/babel-preset/node_preset'],
22+
ignore: ['**/*.test.ts', '**/__fixture__/**'],
23+
};

0 commit comments

Comments
 (0)