Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-59928
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Mar 13, 2020
2 parents dac5a4b + 6b6a7b6 commit 98b9670
Show file tree
Hide file tree
Showing 515 changed files with 28,326 additions and 1,935 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.es
.DS_Store
.node_binaries
.native_modules
node_modules
!/src/dev/npm/integration_tests/__fixtures__/fixture1/node_modules
!/src/dev/notice/__fixtures__/node_modules
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
library 'kibana-pipeline-library'
kibanaLibrary.load()

kibanaPipeline(timeoutMinutes: 135) {
kibanaPipeline(timeoutMinutes: 135, checkPrChanges: true) {
githubPr.withDefaultPrComments {
catchError {
retryable.enable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A function that returns a context value for a specific key of given context type
<b>Signature:</b>

```typescript
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];
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];
```

## Remarks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A function that returns a context value for a specific key of given context type
<b>Signature:</b>

```typescript
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];
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];
```

## Remarks
Expand Down
146 changes: 146 additions & 0 deletions docs/epm/index.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
[role="xpack"]
[[epm]]
== Elastic Package Manager

These are the docs for the Elastic Package Manager (EPM).


=== Configuration

The Elastic Package Manager by default access `epr.elastic.co` to retrieve the package. The url can be configured with:

```
xpack.epm.registryUrl: 'http://localhost:8080'
```

=== API

The Package Manager offers an API. Here an example on how they can be used.

List installed packages:

```
curl localhost:5601/api/ingest_manager/epm/packages
```

Install a package:

```
curl -X POST localhost:5601/api/ingest_manager/epm/packages/iptables-1.0.4
```

Delete a package:

```
curl -X DELETE localhost:5601/api/ingest_manager/epm/packages/iptables-1.0.4
```

=== Definitions

This section is to define terms used across ingest management.

==== Elastic Agent
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.

==== Namespace
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.

==== Package

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 .


== Indexing Strategy

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:

```
{type}-{dataset}-{namespace}
```

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.

Note: More `{type}`s might be added in the future like `apm` and `endpoint`.

This indexing strategy has a few advantages:

* Each index contains only the fields which are relevant for the dataset. This leads to more dense indices and better field completion.
* ILM policies can be applied per namespace per dataset.
* Rollups can be specified per namespace per dataset.
* Having the namespace user configurable makes setting security permissions possible.
* 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.
* 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.

=== Ingest Pipeline

The ingest pipelines for a specific dataset will have the following naming scheme:

```
{type}-{dataset}-{package.version}
```

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.

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.

=== Templates & ILM Policies

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.

The `metrics` and `logs` alias template contain all the basic fields from ECS.

Each type template contains an ILM policy. Modifying this default ILM policy will affect all data covered by the default templates.

The templates for a dataset are called as following:

```
{type}-{dataset}
```

The pattern used inside the index template is `{type}-{dataset}-*` to match all namespaces.

=== Defaults

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.

=== Data filtering

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.

=== Security permissions

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:

```
/(logs|metrics)-[^-]+-prod-$/
```

To set specific permissions on the logs index, the following can be used:

```
/^(logs|metrics)-.*/
```

Todo: The above queries need to be tested.



== Package Manager

=== Package Upgrades

When upgrading a package between a bugfix or a minor version, no breaking changes should happen. Upgrading a package has the following effect:

* Removal of existing dashboards
* Installation of new dashboards
* Write new ingest pipelines with the version
* Write new Elasticsearch alias templates
* Trigger a rollover for all the affected indices

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.

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.

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.


3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"@kbn/test-subj-selector": "0.2.1",
"@kbn/ui-framework": "1.0.0",
"@kbn/ui-shared-deps": "1.0.0",
"@types/tar": "^4.0.3",
"JSONStream": "1.3.5",
"abortcontroller-polyfill": "^1.4.0",
"angular": "^1.7.9",
Expand Down Expand Up @@ -224,6 +225,7 @@
"pug": "^2.0.4",
"query-string": "6.10.1",
"raw-loader": "3.1.0",
"re2": "1.10.5",
"react": "^16.12.0",
"react-color": "^2.13.8",
"react-dom": "^16.12.0",
Expand Down Expand Up @@ -448,6 +450,7 @@
"listr": "^0.14.1",
"load-grunt-config": "^3.0.1",
"mocha": "^6.2.2",
"mock-http-server": "1.3.0",
"multistream": "^2.1.1",
"murmurhash3js": "3.0.1",
"mutation-observer": "^1.0.3",
Expand Down
4 changes: 3 additions & 1 deletion src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,10 @@ export interface IContextContainer<THandler extends HandlerFunction<any>> {
registerContext<TContextName extends keyof HandlerContextType<THandler>>(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider<THandler, TContextName>): this;
}

// Warning: (ae-forgotten-export) The symbol "PartialExceptFor" needs to be exported by the entry point index.d.ts
//
// @public
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];
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];

// @public (undocumented)
export interface IHttpFetchError extends Error {
Expand Down
130 changes: 60 additions & 70 deletions src/core/server/rendering/views/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,28 @@ export const Styles: FunctionComponent<Props> = ({ darkMode }) => {
<style
dangerouslySetInnerHTML={{
__html: `
* {
*, *:before, *:after {
box-sizing: border-box;
}
html, body, div, span, svg {
margin: 0;
padding: 0;
border: none;
vertical-align: baseline;
}
body, html {
width: 100%;
height: 100%;
margin: 0;
display: block;
}
.kibanaWelcomeView {
.kbnWelcomeView {
line-height: 1.5;
background-color: #FFF;
height: 100%;
display: -webkit-box;
display: -webkit-flex;
Expand All @@ -67,101 +78,80 @@ export const Styles: FunctionComponent<Props> = ({ darkMode }) => {
justify-content: center;
}
.kibanaWelcomeLogo {
width: 60px;
height: 60px;
margin: 10px 0 10px 20px;
background-repeat: no-repeat;
background-size: contain;
/* SVG optimized according to http://codepen.io/tigt/post/optimizing-svgs-in-data-uris */
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzOSIgdmlld0JveD0iMCAwIDMwIDM5Ij4gIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+ICAgIDxwb2x5Z29uIGZpbGw9IiNGMDRFOTgiIHBvaW50cz0iMCAwIDAgMzQuNTQ3IDI5LjkyMiAuMDIiLz4gICAgPHBhdGggZmlsbD0iIzM0Mzc0MSIgZD0iTTAsMTQuNCBMMCwzNC41NDY4IEwxNC4yODcyLDE4LjA2MTIgQzEwLjA0MTYsMTUuNzM4IDUuMTgwNCwxNC40IDAsMTQuNCIvPiAgICA8cGF0aCBmaWxsPSIjMDBCRkIzIiBkPSJNMTcuMzc0MiwxOS45OTY4IEwyLjcyMSwzNi45MDQ4IEwxLjQzMzQsMzguMzg5MiBMMjkuMjYzOCwzOC4zODkyIEMyNy43NjE0LDMwLjgzODggMjMuNDA0MiwyNC4zMjY0IDE3LjM3NDIsMTkuOTk2OCIvPiAgPC9nPjwvc3ZnPg==');
}
.kibanaWelcomeTitle {
.kbnWelcomeTitle {
color: #000;
font-size: 20px;
font-family: sans-serif;
margin-top: 20px;
margin: 16px 0;
animation: fadeIn 1s ease-in-out;
animation-fill-mode: forwards;
opacity: 0;
animation-delay: 1.0s;
}
.kibanaWelcomeText {
.kbnWelcomeText {
font-family:
display: inline-block;
font-size: 14px;
font-family: sans-serif;
line-height: 40px !important;
height: 40px !important;
color: #98a2b3;
animation: fadeIn 1s ease-in-out;
animation-fill-mode: forwards;
opacity: 0;
animation-delay: 1.0s;
}
.kibanaLoaderWrap {
height: 128px;
width: 128px;
position: relative;
margin-top: 40px;
.kbnLoaderWrap {
text-align: center;
line-height: 1;
text-align: center;
font-faimily: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial !important;
letter-spacing: -.005em;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
font-kerning: normal;
font-weight: 400;
}
.kibanaLoaderWrap + * {
margin-top: 24px;
.kbnLoaderWrap svg {
width: 64px;
height: 64px;
margin: auto;
line-height: 1;
}
.kibanaLoader {
height: 128px;
width: 128px;
margin: 0 auto;
.kbnLoader path {
stroke: white;
}
.kbnProgress {
display: inline-block;
position: relative;
border: 2px solid transparent;
border-top: 2px solid #017d73;
border-radius: 100%;
display: block;
opacity: 0;
animation: rotation .75s .5s infinite linear, fadeIn 1s .5s ease-in-out forwards;
width: 32px;
height: 4px;
overflow: hidden;
background-color: #D3DAE6;
line-height: 1;
}
.kibanaWelcomeLogoCircle {
.kbnProgress:before {
position: absolute;
left: 4px;
top: 4px;
width: 120px;
height: 120px;
padding: 20px;
background-color: #fff;
border-radius: 50%;
animation: bounceIn .5s ease-in-out;
content: '';
height: 4px;
width: 100%;
top: 0;
bottom: 0;
left: 0;
transform: scaleX(0) translateX(0%);
animation: kbnProgress 1s cubic-bezier(.694, .0482, .335, 1) infinite;
background-color: #006DE4;
}
@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes bounceIn {
@keyframes kbnProgress {
0% {
opacity: 0;
transform: scale(.1);
}
80% {
opacity: .5;
transform: scale(1.2);
transform: scaleX(1) translateX(-100%);
}
100% {
opacity: 1;
transform: scale(1);
transform: scaleX(1) translateX(100%);
}
}
`,
Expand Down
Loading

0 comments on commit 98b9670

Please sign in to comment.