Skip to content

Commit dfaae1d

Browse files
committed
Merge with master
2 parents c04f180 + c6ec5d4 commit dfaae1d

592 files changed

Lines changed: 29656 additions & 2819 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.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: 8.0 Breaking change
3+
about: Breaking changes from 7.x -> 8.0
4+
title: "[Breaking change]"
5+
labels: Team:Elasticsearch UI, Feature:Upgrade Assistant
6+
assignees: ''
7+
8+
---
9+
10+
## Change description
11+
12+
**Which release will ship the breaking change?**
13+
14+
<!-- e.g., v7.6.2 -->
15+
16+
**Describe the change. How will it manifest to users?**
17+
18+
**What percentage of users will be affected?**
19+
20+
<!-- e.g., Roughly 75% will need to make changes to x. -->
21+
22+
**What can users to do to address the change manually?**
23+
24+
<!-- If applicable, describe the manual workaround -->
25+
26+
**How could we make migration easier with the Upgrade Assistant?**
27+
28+
**Are there any edge cases?**
29+
30+
## Test Data
31+
32+
Provide test data. We can’t build a solution without data to test it against.
33+
34+
## Cross links
35+
36+
Cross-link to relevant [Elasticsearch breaking changes](https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-8.0.html).

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/.es
55
.DS_Store
66
.node_binaries
7+
.native_modules
78
node_modules
89
!/src/dev/npm/integration_tests/__fixtures__/fixture1/node_modules
910
!/src/dev/notice/__fixtures__/node_modules

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
library 'kibana-pipeline-library'
44
kibanaLibrary.load()
55

6-
kibanaPipeline(timeoutMinutes: 135) {
6+
kibanaPipeline(timeoutMinutes: 135, checkPrChanges: true) {
77
githubPr.withDefaultPrComments {
88
catchError {
99
retryable.enable()

docs/development/core/public/kibana-plugin-core-public.icontextprovider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A function that returns a context value for a specific key of given context type
99
<b>Signature:</b>
1010

1111
```typescript
12-
export declare type IContextProvider<THandler extends HandlerFunction<any>, TContextName extends keyof HandlerContextType<THandler>> = (context: Partial<HandlerContextType<THandler>>, ...rest: HandlerParameters<THandler>) => Promise<HandlerContextType<THandler>[TContextName]> | HandlerContextType<THandler>[TContextName];
12+
export declare type IContextProvider<THandler extends HandlerFunction<any>, TContextName extends keyof HandlerContextType<THandler>> = (context: PartialExceptFor<HandlerContextType<THandler>, 'core'>, ...rest: HandlerParameters<THandler>) => Promise<HandlerContextType<THandler>[TContextName]> | HandlerContextType<THandler>[TContextName];
1313
```
1414

1515
## Remarks

docs/development/core/server/kibana-plugin-core-server.icontextprovider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A function that returns a context value for a specific key of given context type
99
<b>Signature:</b>
1010

1111
```typescript
12-
export declare type IContextProvider<THandler extends HandlerFunction<any>, TContextName extends keyof HandlerContextType<THandler>> = (context: Partial<HandlerContextType<THandler>>, ...rest: HandlerParameters<THandler>) => Promise<HandlerContextType<THandler>[TContextName]> | HandlerContextType<THandler>[TContextName];
12+
export declare type IContextProvider<THandler extends HandlerFunction<any>, TContextName extends keyof HandlerContextType<THandler>> = (context: PartialExceptFor<HandlerContextType<THandler>, 'core'>, ...rest: HandlerParameters<THandler>) => Promise<HandlerContextType<THandler>[TContextName]> | HandlerContextType<THandler>[TContextName];
1313
```
1414

1515
## Remarks

docs/epm/index.asciidoc

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
[role="xpack"]
2+
[[epm]]
3+
== Elastic Package Manager
4+
5+
These are the docs for the Elastic Package Manager (EPM).
6+
7+
8+
=== Configuration
9+
10+
The Elastic Package Manager by default access `epr.elastic.co` to retrieve the package. The url can be configured with:
11+
12+
```
13+
xpack.epm.registryUrl: 'http://localhost:8080'
14+
```
15+
16+
=== API
17+
18+
The Package Manager offers an API. Here an example on how they can be used.
19+
20+
List installed packages:
21+
22+
```
23+
curl localhost:5601/api/ingest_manager/epm/packages
24+
```
25+
26+
Install a package:
27+
28+
```
29+
curl -X POST localhost:5601/api/ingest_manager/epm/packages/iptables-1.0.4
30+
```
31+
32+
Delete a package:
33+
34+
```
35+
curl -X DELETE localhost:5601/api/ingest_manager/epm/packages/iptables-1.0.4
36+
```
37+
38+
=== Definitions
39+
40+
This section is to define terms used across ingest management.
41+
42+
==== Elastic Agent
43+
A single, unified agent that users can deploy to hosts or containers. It controls which data is collected from the host or containers and where the data is sent. It will run Beats, Endpoint or other monitoring programs as needed. It can operate standalone or pull a configuration policy from Fleet.
44+
45+
==== Namespace
46+
A user-specified string that will be used to part of the index name in Elasticsearch. It helps users identify logs coming from a specific environment (like prod or test), an application, or other identifiers.
47+
48+
==== Package
49+
50+
A package contains all the assets for the Elastic Stack. A more detailed definition of a package can be found under https://github.com/elastic/package-registry .
51+
52+
53+
== Indexing Strategy
54+
55+
Ingest Management enforces an indexing strategy to allow the system to automically detect indices and run queries on it. In short the indexing strategy looks as following:
56+
57+
```
58+
{type}-{dataset}-{namespace}
59+
```
60+
61+
The `{type}` can be `logs` or `metrics`. The `{namespace}` is the part where the user can use free form. The only two requirement are that it has only characters allowed in an Elasticsearch index name and does NOT contain a `-`. The `dataset` is defined by the data that is indexed. The same requirements as for the namespace apply. It is expected that the fields for type, namespace and dataset are part of each event and are constant keywords.
62+
63+
Note: More `{type}`s might be added in the future like `apm` and `endpoint`.
64+
65+
This indexing strategy has a few advantages:
66+
67+
* Each index contains only the fields which are relevant for the dataset. This leads to more dense indices and better field completion.
68+
* ILM policies can be applied per namespace per dataset.
69+
* Rollups can be specified per namespace per dataset.
70+
* Having the namespace user configurable makes setting security permissions possible.
71+
* Having a global metrics and logs template, allows to create new indices on demand which still follow the convention. This is common in the case of k8s as an example.
72+
* Constant keywords allow to narrow down the indices we need to access for querying very efficiently. This is especially relevant in environments which a large number of indices or with indices on slower nodes.
73+
74+
=== Ingest Pipeline
75+
76+
The ingest pipelines for a specific dataset will have the following naming scheme:
77+
78+
```
79+
{type}-{dataset}-{package.version}
80+
```
81+
82+
As an example, the ingest pipeline for the Nginx access logs is called `logs-nginx.access-3.4.1`. The same ingest pipeline is used for all namespaces. It is possible that a dataset has multiple ingest pipelines in which case a suffix is added to the name.
83+
84+
The version is included in each pipeline to allow upgrades. The pipeline itself is listed in the index template and is automatically applied at ingest time.
85+
86+
=== Templates & ILM Policies
87+
88+
To make the above strategy possible, alias templates are required. For each type there is a basic alias template with a default ILM policy. These default templates apply to all indices which follow the indexing strategy and do not have a more specific dataset alias template.
89+
90+
The `metrics` and `logs` alias template contain all the basic fields from ECS.
91+
92+
Each type template contains an ILM policy. Modifying this default ILM policy will affect all data covered by the default templates.
93+
94+
The templates for a dataset are called as following:
95+
96+
```
97+
{type}-{dataset}
98+
```
99+
100+
The pattern used inside the index template is `{type}-{dataset}-*` to match all namespaces.
101+
102+
=== Defaults
103+
104+
If the Elastic Agent is used to ingest data and only the type is specified, `default` for the namespace is used and `generic` for the dataset.
105+
106+
=== Data filtering
107+
108+
Filtering for data in queries for example in visualizations or dashboards should always be done on the constant keyword fields. Visualizations needing data for the nginx.access dataset should query on `type:logs AND dataset:nginx.access`. As these are constant keywords the prefiltering is very efficient.
109+
110+
=== Security permissions
111+
112+
Security permissions can be set on different levels. To set special permissions for the access on the prod namespace an index pattern as below can be used:
113+
114+
```
115+
/(logs|metrics)-[^-]+-prod-$/
116+
```
117+
118+
To set specific permissions on the logs index, the following can be used:
119+
120+
```
121+
/^(logs|metrics)-.*/
122+
```
123+
124+
Todo: The above queries need to be tested.
125+
126+
127+
128+
== Package Manager
129+
130+
=== Package Upgrades
131+
132+
When upgrading a package between a bugfix or a minor version, no breaking changes should happen. Upgrading a package has the following effect:
133+
134+
* Removal of existing dashboards
135+
* Installation of new dashboards
136+
* Write new ingest pipelines with the version
137+
* Write new Elasticsearch alias templates
138+
* Trigger a rollover for all the affected indices
139+
140+
The new ingest pipeline is expected to still work with the data coming from older configurations. In most cases this means some of the fields can be missing. For this to work, each event must contain the version of config / package it is coming from to make such a decision.
141+
142+
In case of a breaking change in the data structure, the new ingest pipeline is also expected to deal with this change. In case there are breaking changes which cannot be dealt with in an ingest pipeline, a new package has to be created.
143+
144+
Each package lists its minimal required agent version. In case there are agents enrolled with an older version, the user is notified to upgrade these agents as otherwise the new configs cannot be rolled out.
145+
146+

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
"@kbn/test-subj-selector": "0.2.1",
139139
"@kbn/ui-framework": "1.0.0",
140140
"@kbn/ui-shared-deps": "1.0.0",
141+
"@types/tar": "^4.0.3",
141142
"JSONStream": "1.3.5",
142143
"abortcontroller-polyfill": "^1.4.0",
143144
"angular": "^1.7.9",
@@ -227,6 +228,7 @@
227228
"pug": "^2.0.4",
228229
"query-string": "6.10.1",
229230
"raw-loader": "3.1.0",
231+
"re2": "1.10.5",
230232
"react": "^16.12.0",
231233
"react-color": "^2.13.8",
232234
"react-dom": "^16.12.0",
@@ -454,6 +456,7 @@
454456
"listr": "^0.14.1",
455457
"load-grunt-config": "^3.0.1",
456458
"mocha": "^6.2.2",
459+
"mock-http-server": "1.3.0",
457460
"multistream": "^2.1.1",
458461
"murmurhash3js": "3.0.1",
459462
"mutation-observer": "^1.0.3",

renovate.json5

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,14 @@
431431
'@types/jquery',
432432
],
433433
},
434+
{
435+
groupSlug: 'js-search',
436+
groupName: 'js-search related packages',
437+
packageNames: [
438+
'js-search',
439+
'@types/js-search',
440+
],
441+
},
434442
{
435443
groupSlug: 'js-yaml',
436444
groupName: 'js-yaml related packages',
@@ -877,6 +885,14 @@
877885
'@types/supertest-as-promised',
878886
],
879887
},
888+
{
889+
groupSlug: 'tar',
890+
groupName: 'tar related packages',
891+
packageNames: [
892+
'tar',
893+
'@types/tar',
894+
],
895+
},
880896
{
881897
groupSlug: 'tar-fs',
882898
groupName: 'tar-fs related packages',

src/core/public/public.api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,10 @@ export interface IContextContainer<THandler extends HandlerFunction<any>> {
735735
registerContext<TContextName extends keyof HandlerContextType<THandler>>(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider<THandler, TContextName>): this;
736736
}
737737

738+
// Warning: (ae-forgotten-export) The symbol "PartialExceptFor" needs to be exported by the entry point index.d.ts
739+
//
738740
// @public
739-
export type IContextProvider<THandler extends HandlerFunction<any>, TContextName extends keyof HandlerContextType<THandler>> = (context: Partial<HandlerContextType<THandler>>, ...rest: HandlerParameters<THandler>) => Promise<HandlerContextType<THandler>[TContextName]> | HandlerContextType<THandler>[TContextName];
741+
export type IContextProvider<THandler extends HandlerFunction<any>, TContextName extends keyof HandlerContextType<THandler>> = (context: PartialExceptFor<HandlerContextType<THandler>, 'core'>, ...rest: HandlerParameters<THandler>) => Promise<HandlerContextType<THandler>[TContextName]> | HandlerContextType<THandler>[TContextName];
740742

741743
// @public (undocumented)
742744
export interface IHttpFetchError extends Error {

src/core/server/server.api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,10 @@ export interface IContextContainer<THandler extends HandlerFunction<any>> {
882882
registerContext<TContextName extends keyof HandlerContextType<THandler>>(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider<THandler, TContextName>): this;
883883
}
884884

885+
// Warning: (ae-forgotten-export) The symbol "PartialExceptFor" needs to be exported by the entry point index.d.ts
886+
//
885887
// @public
886-
export type IContextProvider<THandler extends HandlerFunction<any>, TContextName extends keyof HandlerContextType<THandler>> = (context: Partial<HandlerContextType<THandler>>, ...rest: HandlerParameters<THandler>) => Promise<HandlerContextType<THandler>[TContextName]> | HandlerContextType<THandler>[TContextName];
888+
export type IContextProvider<THandler extends HandlerFunction<any>, TContextName extends keyof HandlerContextType<THandler>> = (context: PartialExceptFor<HandlerContextType<THandler>, 'core'>, ...rest: HandlerParameters<THandler>) => Promise<HandlerContextType<THandler>[TContextName]> | HandlerContextType<THandler>[TContextName];
887889

888890
// @public
889891
export interface ICspConfig {

0 commit comments

Comments
 (0)