Skip to content

Commit 3a09f83

Browse files
Merge branch 'master' into 65761-custom-metric-alert-ui
2 parents d7be45e + ed19912 commit 3a09f83

574 files changed

Lines changed: 5926 additions & 3653 deletions

File tree

Some content is hidden

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

docs/api/saved-objects/rotate_encryption_key.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Bulk key rotation can consume a considerable amount of resources and hence only
2525
`type`::
2626
(Optional, string) Limits encryption key rotation only to the saved objects with the specified type. By default, {kib} tries to rotate the encryption key for all saved object types that may contain encrypted attributes.
2727

28-
`batchSize`::
28+
`batch_size`::
2929
(Optional, number) Specifies a maximum number of saved objects that {kib} can process in a single batch. Bulk key rotation is an iterative process since {kib} may not be able to fetch and process all required saved objects in one go and splits processing into consequent batches. By default, the batch size is 10000, which is also a maximum allowed value.
3030

3131
[[saved-objects-api-rotate-encryption-key-response-body]]
@@ -91,7 +91,7 @@ In this example, key rotation is performed for all saved objects with the `alert
9191

9292
[source,sh]
9393
--------------------------------------------------
94-
$ curl -X POST /api/encrypted_saved_objects/_rotate_key?type=alert&batchSize=5000
94+
$ curl -X POST /api/encrypted_saved_objects/_rotate_key?type=alert&batch_size=5000
9595
--------------------------------------------------
9696
// KIBANA
9797

docs/developer/contributing/development-ci-metrics.asciidoc

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
In addition to running our tests, CI collects metrics about the Kibana build. These metrics are sent to an external service to track changes over time, and to provide PR authors insights into the impact of their changes.
55

6+
* <<ci-metric-types>>
7+
* <<ci-metric-resolving-overages>>
8+
* <<ci-metric-validating-limits>>
9+
610

711
[[ci-metric-types]]
812
=== Metric types
@@ -16,7 +20,7 @@ These metrics help contributors know how they are impacting the size of the bund
1620
[[ci-metric-page-load-bundle-size]] `page load bundle size` ::
1721
The size of the entry file produced for each bundle/plugin. This file is always loaded on every page load, so it should be as small as possible. To reduce this metric you can put any code that isn't necessary on every page load behind an https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports[`async import()`].
1822
+
19-
Code that is shared statically with other plugins will contribute to the `page load bundle size` of that plugin. This includes exports from the `public/index.ts` file and any file referenced by the `extraPublicDirs` manifest property.
23+
Code that is shared statically with other plugins will contribute to the `page load bundle size` of that plugin. This includes exports from the `public/index.ts` file and any file referenced by the `extraPublicDirs` manifest property.
2024

2125
[[ci-metric-async-chunks-size]] `async chunks size` ::
2226
An "async chunk" is created for the files imported by each https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports[`async import()`] statement. This metric tracks the sum size of these chunks, in bytes, broken down by plugin/bundle id. You can think of this as the amount of code users will have to download if they access all the components/applications within a bundle.
@@ -44,7 +48,7 @@ The number of files included in the default distributable.
4448
The number of files included in the OSS distributable.
4549

4650
[[ci-metric-distributable-size]] `distributable size` ::
47-
The size, in bytes, of the default distributable. _(not reported on PRs)_
51+
The size, in bytes, of the default distributable. _(not reported on PRs)_
4852

4953
[[ci-metric-oss-distributable-size]] `oss distributable size` ::
5054
The size, in bytes, of the OSS distributable. _(not reported on PRs)_
@@ -62,4 +66,74 @@ The number of saved object fields broken down by saved object type.
6266
[[ci-metric-adding-new-metrics]]
6367
=== Adding new metrics
6468

65-
You can report new metrics by using the `CiStatsReporter` class provided by the `@kbn/dev-utils` package. This class is automatically configured on CI and its methods noop when running outside of CI. For more details checkout the {kib-repo}blob/{branch}/packages/kbn-dev-utils/src/ci_stats_reporter[`CiStatsReporter` readme].
69+
You can report new metrics by using the `CiStatsReporter` class provided by the `@kbn/dev-utils` package. This class is automatically configured on CI and its methods noop when running outside of CI. For more details checkout the {kib-repo}blob/{branch}/packages/kbn-dev-utils/src/ci_stats_reporter[`CiStatsReporter` readme].
70+
71+
[[ci-metric-resolving-overages]]
72+
=== Resolving `page load bundle size` overages
73+
74+
In order to prevent the page load bundles from growing unexpectedly large we limit the `page load asset size` metric for each plugin. When a PR increases this metric beyond the limit defined for that plugin in {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml`] a failed commit status is set and the PR author needs to decide how to resolve this issue before the PR can be merged.
75+
76+
In most cases the limit should be high enough that PRs shouldn't trigger overages, but when they do make sure it's clear what is cuasing the overage by trying the following:
77+
78+
1. Run the optimizer locally with the `--profile` flag to produce webpack `stats.json` files for bundles which can be inspected using a number of different online tools. Focus on the chunk named `{pluginId}.plugin.js`; the `*.chunk.js` chunks make up the `async chunks size` metric which is currently unlimited and is the main way that we {kib-repo}blob/{branch}/src/core/MIGRATION.md#keep-kibana-fast[reduce the size of page load chunks].
79+
+
80+
[source,shell]
81+
-----------
82+
node scripts/build_kibana_platform_plugins --focus {pluginid} --profile
83+
# builds and creates {pluginDir}target/public/stats.json files for {pluginId} and any plugin it depends on
84+
-----------
85+
86+
- Official Webpack tool: http://webpack.github.io/analyse/
87+
- Webpack visualizer: https://chrisbateman.github.io/webpack-visualizer/
88+
89+
2. You might want to create stats for the upstream branch of your PR as well and then compare them side by side in Webpack visualizer to spot where the size difference is (using two browser tabs).
90+
91+
3. For relatively small changes you might be able to better understand the problem by sticking stats.json files from two different branches into https://www.scootersoftware.com/download.php[Beyond Compare]
92+
93+
4. If the number of changes in https://www.scootersoftware.com/download.php[Beyond Compare] are too large, you can reduce the stats.json file down to just a sorted list of module ids using https://github.com/stedolan/jq[jq]:
94+
+
95+
[source,shell]
96+
-----------
97+
jq -r .modules[].id {pluginDir}/target/public/stats.json | sort - > moduleids.txt
98+
-----------
99+
+
100+
Produce a moduleids.txt file for both your branch and master and then pop them into Beyond Compare to get a very specific view of what's new.
101+
102+
5. As a last resort you might want to try comparing the bundle source directly. It's usually best to do this using the production source so that you're inspecting the actual change in bytes that CI is seeing. After building the distributable version of your bundle run it through prettier and then dropping it into Beyond Compare along with the chunk from upstream:
103+
+
104+
[source,shell]
105+
-----------
106+
node scripts/build_kibana_platform_plugins --focus {pluginId} --dist
107+
npm install -g prettier
108+
prettier -w {pluginDir}/target/public/{pluginId}.plugin.js
109+
# repeat these steps for upstream and then compare the two {pluginId}.plugin.js files in Beyond Compare
110+
-----------
111+
112+
6. If all else fails reach out to Operations for help.
113+
114+
Once you've identified the files which were added to the build you likely just need to stick them behind an async import as described in {kib-repo}blob/{branch}/src/core/MIGRATION.md#keep-kibana-fast[the MIGRATION.md docs].
115+
116+
In the case that the bundle size is not being bloated by anything obvious, but it's still larger than the limit, you can raise the limit in your PR. Do this either by editting the {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml` file] manually or by running the following to have the limit updated to the current size + 15kb
117+
118+
[source,shell]
119+
-----------
120+
node scripts/build_kibana_platform_plugins --focus {pluginId} --update-limits
121+
-----------
122+
123+
This command has to run the optimizer in distributable mode so it will take a lot longer and spawn one worker for each CPU on your machine.
124+
125+
Changes to the {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml` file] will trigger review from the Operations team, who will attempt to verify that the size increase is justified. If you have findings you can share from the steps above that would be very helpful!
126+
127+
[[ci-metric-validating-limits]]
128+
=== Validating `page load bundle size` limits
129+
130+
Once you've fixed any issues discovered while diagnosing overages you probably should just push the changes to your PR and let CI validate them.
131+
132+
If you have a pretty powerful dev machine, or the necessary patience/determination, you can validate the limits locally by running the following command:
133+
134+
[source,shell]
135+
-----------
136+
node scripts/build_kibana_platform_plugins --validate-limits
137+
-----------
138+
139+
This command needs to apply production optimizations to get the right sizes, which means that the optimizer will take significantly longer to run and on most developmer machines will consume all of your machines resources for 20 minutes or more. If you'd like to multi-task while this is running you might need to limit the number of workers using the `--max-workers` flag.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExpressionFunctionDefinitions](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.md) &gt; [derivative](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.derivative.md)
4+
5+
## ExpressionFunctionDefinitions.derivative property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
derivative: ExpressionFunctionDerivative;
11+
```

docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface ExpressionFunctionDefinitions
1818
| --- | --- | --- |
1919
| [clog](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.clog.md) | <code>ExpressionFunctionClog</code> | |
2020
| [cumulative\_sum](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.cumulative_sum.md) | <code>ExpressionFunctionCumulativeSum</code> | |
21+
| [derivative](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.derivative.md) | <code>ExpressionFunctionDerivative</code> | |
2122
| [font](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.font.md) | <code>ExpressionFunctionFont</code> | |
2223
| [kibana\_context](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.kibana_context.md) | <code>ExpressionFunctionKibanaContext</code> | |
2324
| [kibana](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.kibana.md) | <code>ExpressionFunctionKibana</code> | |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-server](./kibana-plugin-plugins-expressions-server.md) &gt; [ExpressionFunctionDefinitions](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.md) &gt; [derivative](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.derivative.md)
4+
5+
## ExpressionFunctionDefinitions.derivative property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
derivative: ExpressionFunctionDerivative;
11+
```

docs/development/plugins/expressions/server/kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface ExpressionFunctionDefinitions
1818
| --- | --- | --- |
1919
| [clog](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.clog.md) | <code>ExpressionFunctionClog</code> | |
2020
| [cumulative\_sum](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.cumulative_sum.md) | <code>ExpressionFunctionCumulativeSum</code> | |
21+
| [derivative](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.derivative.md) | <code>ExpressionFunctionDerivative</code> | |
2122
| [font](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.font.md) | <code>ExpressionFunctionFont</code> | |
2223
| [kibana\_context](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.kibana_context.md) | <code>ExpressionFunctionKibanaContext</code> | |
2324
| [kibana](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.kibana.md) | <code>ExpressionFunctionKibana</code> | |

package.json

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
"url": "https://github.com/elastic/kibana.git"
7878
},
7979
"resolutions": {
80+
"**/@hapi/iron": "^5.1.4",
81+
"**/@types/hapi__boom": "^7.4.1",
82+
"**/@types/hapi__hapi": "^18.2.6",
83+
"**/@types/hapi__mimos": "4.1.0",
8084
"**/@types/node": ">=10.17.17 <10.20.0",
8185
"**/cross-fetch/node-fetch": "^2.6.1",
8286
"**/deepmerge": "^4.2.2",
@@ -110,19 +114,30 @@
110114
"**/grunt-*/**",
111115
"x-pack/typescript",
112116
"@elastic/eui/rehype-react",
117+
"@elastic/eui/remark-parse",
113118
"@elastic/eui/remark-rehype",
114-
"@elastic/eui/remark-rehype/**"
119+
"@elastic/eui/remark-rehype/**",
120+
"@elastic/eui/unified"
115121
]
116122
},
117123
"dependencies": {
118124
"@elastic/datemath": "5.0.3",
119125
"@elastic/elasticsearch": "7.10.0-rc.1",
120-
"@elastic/eui": "29.5.0",
126+
"@elastic/eui": "30.1.1",
121127
"@elastic/good": "8.1.1-kibana2",
122128
"@elastic/numeral": "^2.5.0",
123129
"@elastic/request-crypto": "1.1.4",
124130
"@elastic/safer-lodash-set": "0.0.0",
131+
"@hapi/boom": "^7.4.11",
132+
"@hapi/cookie": "^10.1.2",
125133
"@hapi/good-squeeze": "5.2.1",
134+
"@hapi/h2o2": "^8.3.2",
135+
"@hapi/hapi": "^18.4.1",
136+
"@hapi/hoek": "^8.5.1",
137+
"@hapi/inert": "^5.2.2",
138+
"@hapi/podium": "^3.4.3",
139+
"@hapi/statehood": "^6.1.2",
140+
"@hapi/vision": "^5.5.4",
126141
"@hapi/wreck": "^15.0.2",
127142
"@kbn/ace": "1.0.0",
128143
"@kbn/analytics": "1.0.0",
@@ -145,7 +160,6 @@
145160
"angular-elastic": "^2.5.1",
146161
"angular-sanitize": "^1.8.0",
147162
"bluebird": "3.5.5",
148-
"boom": "^7.2.0",
149163
"chalk": "^4.1.0",
150164
"check-disk-space": "^2.1.0",
151165
"chokidar": "^3.4.2",
@@ -165,15 +179,10 @@
165179
"glob": "^7.1.2",
166180
"glob-all": "^3.2.1",
167181
"globby": "^8.0.1",
168-
"h2o2": "^8.1.2",
169182
"handlebars": "4.7.6",
170-
"hapi": "^17.5.3",
171-
"hapi-auth-cookie": "^9.0.0",
172183
"hjson": "3.2.1",
173-
"hoek": "^5.0.4",
174184
"http-proxy-agent": "^2.1.0",
175185
"https-proxy-agent": "^5.0.0",
176-
"inert": "^5.1.0",
177186
"inline-style": "^2.0.0",
178187
"joi": "^13.5.2",
179188
"js-yaml": "^3.14.0",
@@ -218,7 +227,6 @@
218227
"tslib": "^2.0.0",
219228
"type-detect": "^4.0.8",
220229
"uuid": "3.3.2",
221-
"vision": "^5.3.3",
222230
"whatwg-fetch": "^3.0.0",
223231
"yauzl": "^2.10.0"
224232
},
@@ -272,7 +280,6 @@
272280
"@types/archiver": "^3.1.0",
273281
"@types/babel__core": "^7.1.10",
274282
"@types/bluebird": "^3.1.1",
275-
"@types/boom": "^7.2.0",
276283
"@types/chance": "^1.0.0",
277284
"@types/cheerio": "^0.22.10",
278285
"@types/chromedriver": "^81.0.0",
@@ -292,14 +299,16 @@
292299
"@types/glob": "^7.1.2",
293300
"@types/globby": "^8.0.0",
294301
"@types/graphql": "^0.13.2",
295-
"@types/h2o2": "^8.1.1",
296-
"@types/hapi": "^17.0.18",
297-
"@types/hapi-auth-cookie": "^9.1.0",
302+
"@types/hapi__boom": "^7.4.1",
303+
"@types/hapi__cookie": "^10.1.1",
304+
"@types/hapi__h2o2": "8.3.0",
305+
"@types/hapi__hapi": "^18.2.6",
306+
"@types/hapi__hoek": "^6.2.0",
307+
"@types/hapi__inert": "^5.2.1",
308+
"@types/hapi__podium": "^3.4.1",
298309
"@types/has-ansi": "^3.0.0",
299310
"@types/history": "^4.7.3",
300311
"@types/hjson": "^2.4.2",
301-
"@types/hoek": "^4.1.3",
302-
"@types/inert": "^5.1.2",
303312
"@types/jest": "^26.0.14",
304313
"@types/jest-when": "^2.7.1",
305314
"@types/joi": "^13.4.2",
@@ -324,7 +333,6 @@
324333
"@types/opn": "^5.1.0",
325334
"@types/pegjs": "^0.10.1",
326335
"@types/pngjs": "^3.4.0",
327-
"@types/podium": "^1.0.0",
328336
"@types/prop-types": "^15.7.3",
329337
"@types/reach__router": "^1.2.6",
330338
"@types/react": "^16.9.36",

packages/kbn-ui-framework/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@babel/core": "^7.11.6",
34-
"@elastic/eui": "29.5.0",
34+
"@elastic/eui": "30.1.1",
3535
"@kbn/babel-preset": "1.0.0",
3636
"@kbn/optimizer": "1.0.0",
3737
"babel-loader": "^8.0.6",

packages/kbn-ui-shared-deps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@elastic/charts": "24.0.0",
13-
"@elastic/eui": "29.5.0",
13+
"@elastic/eui": "30.1.1",
1414
"@elastic/numeral": "^2.5.0",
1515
"@kbn/i18n": "1.0.0",
1616
"@kbn/monaco": "1.0.0",

src/core/public/chrome/ui/header/recent_links.tsx

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)