Skip to content

Commit daab8d4

Browse files
committed
Merge branch 'master' of github.com:elastic/kibana into update-alert-documents
2 parents 044a5c1 + aa97040 commit daab8d4

628 files changed

Lines changed: 16190 additions & 12021 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.

.ci/Jenkinsfile_flaky

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ library 'kibana-pipeline-library'
44
kibanaLibrary.load()
55

66
def TASK_PARAM = params.TASK ?: params.CI_GROUP
7-
87
// Looks like 'oss:ciGroup:1', 'oss:firefoxSmoke'
98
def JOB_PARTS = TASK_PARAM.split(':')
109
def IS_XPACK = JOB_PARTS[0] == 'xpack'
@@ -111,6 +110,8 @@ def getWorkerFromParams(isXpack, job, ciGroup) {
111110
return kibanaPipeline.scriptTaskDocker('Jest Integration Tests', 'test/scripts/test/jest_integration.sh')
112111
} else if (job == 'apiIntegration') {
113112
return kibanaPipeline.scriptTask('API Integration Tests', 'test/scripts/test/api_integration.sh')
113+
} else if (job == 'pluginFunctional') {
114+
return kibanaPipeline.functionalTestProcess('oss-pluginFunctional', './test/scripts/jenkins_plugin_functional.sh')
114115
} else {
115116
return kibanaPipeline.ossCiGroupProcess(ciGroup)
116117
}

.ci/end2end.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ pipeline {
1313
BASE_DIR = 'src/github.com/elastic/kibana'
1414
HOME = "${env.WORKSPACE}"
1515
E2E_DIR = 'x-pack/plugins/apm/e2e'
16-
PIPELINE_LOG_LEVEL = 'DEBUG'
16+
PIPELINE_LOG_LEVEL = 'INFO'
1717
KBN_OPTIMIZER_THEMES = 'v7light'
1818
}
1919
options {
2020
timeout(time: 1, unit: 'HOURS')
21-
buildDiscarder(logRotator(numToKeepStr: '40', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
21+
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '10', daysToKeepStr: '30'))
2222
timestamps()
2323
ansiColor('xterm')
2424
disableResume()

dev_docs/tutorials/building_a_plugin.mdx

Lines changed: 59 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ slug: /kibana-dev-docs/tutorials/build-a-plugin
44
title: Kibana plugin tutorial
55
summary: Anatomy of a Kibana plugin and how to build one
66
date: 2021-02-05
7-
tags: ['kibana','onboarding', 'dev', 'tutorials']
7+
tags: ['kibana', 'onboarding', 'dev', 'tutorials']
88
---
99

1010
Prereading material:
@@ -14,7 +14,7 @@ Prereading material:
1414
## The anatomy of a plugin
1515

1616
Plugins are defined as classes and present themselves to Kibana through a simple wrapper function. A plugin can have browser-side code, server-side code,
17-
or both. There is no architectural difference between a plugin in the browser and a plugin on the server. In both places, you describe your plugin similarly,
17+
or both. There is no architectural difference between a plugin in the browser and a plugin on the server. In both places, you describe your plugin similarly,
1818
and you interact with Core and other plugins in the same way.
1919

2020
The basic file structure of a Kibana plugin named demo that has both client-side and server-side code would be:
@@ -33,7 +33,7 @@ plugins/
3333
index.ts [6]
3434
```
3535

36-
### [1] kibana.json
36+
### [1] kibana.json
3737

3838
`kibana.json` is a static manifest file that is used to identify the plugin and to specify if this plugin has server-side code, browser-side code, or both:
3939

@@ -42,14 +42,33 @@ plugins/
4242
"id": "demo",
4343
"version": "kibana",
4444
"server": true,
45-
"ui": true
45+
"ui": true,
46+
"owner": { [1]
47+
"name": "App Services",
48+
"githubTeam": "kibana-app-services"
49+
},
50+
"description": "This plugin extends Kibana by doing xyz, and allows other plugins to extend Kibana by offering abc functionality. It also exposes some helper utilities that do efg", [2]
51+
"requiredPlugins": ["data"], [3]
52+
"optionalPlugins": ["alerting"] [4]
53+
"requiredBundles": ["anotherPlugin"] [5]
4654
}
4755
```
4856

57+
[1], [2]: Every internal plugin should fill in the owner and description properties.
58+
59+
[3], [4]: Any plugin that you have a dependency on should be listed in `requiredPlugins` or `optionalPlugins`. Doing this will ensure that you have access to that plugin's start and setup contract inside your own plugin's start and setup lifecycle methods. If a plugin you optionally depend on is not installed or disabled, it will be undefined if you try to access it. If a plugin you require is not installed or disabled, kibana will fail to build.
60+
61+
[5]: Don't worry too much about getting 5 right. The build optimizer will complain if any of these values are incorrect.
62+
63+
64+
<DocCallOut>
65+
You don't need to declare a dependency on a plugin if you only wish to access its types.
66+
</DocCallOut>
67+
4968
### [2] public/index.ts
5069

51-
`public/index.ts` is the entry point into the client-side code of this plugin. It must export a function named plugin, which will receive a standard set of
52-
core capabilities as an argument. It should return an instance of its plugin class for Kibana to load.
70+
`public/index.ts` is the entry point into the client-side code of this plugin. Everything exported from this file will be a part of the plugins <DocLink id="kibPlatformIntro" section="public-plugin-api" text="public API"/>. If the plugin only exists to export static utilities, consider using a package. Otherwise, this file must export a function named plugin, which will receive a standard set of
71+
core capabilities as an argument. It should return an instance of its plugin class for Kibana to load.
5372

5473
```
5574
import type { PluginInitializerContext } from 'kibana/server';
@@ -60,13 +79,32 @@ export function plugin(initializerContext: PluginInitializerContext) {
6079
}
6180
```
6281

82+
<DocCallOut title="Best practices for every top level index.ts file">
83+
84+
1. When possible, use
85+
86+
```
87+
export type { AType } from '...'`
88+
```
89+
90+
instead of
91+
92+
```
93+
export { AType } from '...'`.
94+
```
95+
96+
Using the non-`type` variation will increase the bundle size unnecessarily and may unwillingly provide access to the implementation of `AType` class.
97+
98+
2. Don't use `export *` in these top level index.ts files
99+
100+
</DocCallOut>
101+
63102
### [3] public/plugin.ts
64103

65104
`public/plugin.ts` is the client-side plugin definition itself. Technically speaking, it does not need to be a class or even a separate file from the entry
66-
point, but all plugins at Elastic should be consistent in this way.
105+
point, but all plugins at Elastic should be consistent in this way.
67106

68-
69-
```ts
107+
```ts
70108
import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server';
71109

72110
export class DemoPlugin implements Plugin {
@@ -84,10 +122,9 @@ export class DemoPlugin implements Plugin {
84122
// called when plugin is torn down during Kibana's shutdown sequence
85123
}
86124
}
87-
```
88-
125+
```
89126

90-
### [4] server/index.ts
127+
### [4] server/index.ts
91128

92129
`server/index.ts` is the entry-point into the server-side code of this plugin. It is identical in almost every way to the client-side entry-point:
93130

@@ -115,7 +152,7 @@ export class DemoPlugin implements Plugin {
115152
}
116153
```
117154

118-
Kibana does not impose any technical restrictions on how the the internals of a plugin are architected, though there are certain
155+
Kibana does not impose any technical restrictions on how the the internals of a plugin are architected, though there are certain
119156
considerations related to how plugins integrate with core APIs and APIs exposed by other plugins that may greatly impact how they are built.
120157

121158
### [6] common/index.ts
@@ -124,8 +161,8 @@ considerations related to how plugins integrate with core APIs and APIs exposed
124161

125162
## How plugin's interact with each other, and Core
126163

127-
The lifecycle-specific contracts exposed by core services are always passed as the first argument to the equivalent lifecycle function in a plugin.
128-
For example, the core http service exposes a function createRouter to all plugin setup functions. To use this function to register an HTTP route handler,
164+
The lifecycle-specific contracts exposed by core services are always passed as the first argument to the equivalent lifecycle function in a plugin.
165+
For example, the core http service exposes a function createRouter to all plugin setup functions. To use this function to register an HTTP route handler,
129166
a plugin just accesses it off of the first argument:
130167

131168
```ts
@@ -135,14 +172,16 @@ export class DemoPlugin {
135172
public setup(core: CoreSetup) {
136173
const router = core.http.createRouter();
137174
// handler is called when '/path' resource is requested with `GET` method
138-
router.get({ path: '/path', validate: false }, (context, req, res) => res.ok({ content: 'ok' }));
175+
router.get({ path: '/path', validate: false }, (context, req, res) =>
176+
res.ok({ content: 'ok' })
177+
);
139178
}
140179
}
141180
```
142181

143182
Unlike core, capabilities exposed by plugins are not automatically injected into all plugins.
144183
Instead, if a plugin wishes to use the public interface provided by another plugin, it must first declare that plugin as a
145-
dependency in it’s kibana.json manifest file.
184+
dependency in it’s kibana.json manifest file.
146185

147186
** foobar plugin.ts: **
148187

@@ -174,8 +213,8 @@ export class MyPlugin implements Plugin<FoobarPluginSetup, FoobarPluginStart> {
174213
}
175214
}
176215
```
177-
[1] We highly encourage plugin authors to explicitly declare public interfaces for their plugins.
178216

217+
[1] We highly encourage plugin authors to explicitly declare public interfaces for their plugins.
179218

180219
** demo kibana.json**
181220

@@ -194,7 +233,7 @@ With that specified in the plugin manifest, the appropriate interfaces are then
194233
import type { CoreSetup, CoreStart } from 'kibana/server';
195234
import type { FoobarPluginSetup, FoobarPluginStart } from '../../foobar/server';
196235

197-
interface DemoSetupPlugins { [1]
236+
interface DemoSetupPlugins { [1]
198237
foobar: FoobarPluginSetup;
199238
}
200239

@@ -218,7 +257,7 @@ export class DemoPlugin {
218257
public stop() {}
219258
}
220259
```
221-
260+
222261
[1] The interface for plugin’s dependencies must be manually composed. You can do this by importing the appropriate type from the plugin and constructing an interface where the property name is the plugin’s ID.
223262

224263
[2] These manually constructed types should then be used to specify the type of the second argument to the plugin.

docs/development/core/public/kibana-plugin-core-public.applicationstart.geturlforapp.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Note that when generating absolute urls, the origin (protocol, host and port) ar
1616
getUrlForApp(appId: string, options?: {
1717
path?: string;
1818
absolute?: boolean;
19+
deepLinkId?: string;
1920
}): string;
2021
```
2122

@@ -24,7 +25,7 @@ getUrlForApp(appId: string, options?: {
2425
| Parameter | Type | Description |
2526
| --- | --- | --- |
2627
| appId | <code>string</code> | |
27-
| options | <code>{</code><br/><code> path?: string;</code><br/><code> absolute?: boolean;</code><br/><code> }</code> | |
28+
| options | <code>{</code><br/><code> path?: string;</code><br/><code> absolute?: boolean;</code><br/><code> deepLinkId?: string;</code><br/><code> }</code> | |
2829

2930
<b>Returns:</b>
3031

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
@@ -21,6 +21,7 @@ export interface ExpressionFunctionDefinitions
2121
| [derivative](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.derivative.md) | <code>ExpressionFunctionDerivative</code> | |
2222
| [font](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.font.md) | <code>ExpressionFunctionFont</code> | |
2323
| [moving\_average](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.moving_average.md) | <code>ExpressionFunctionMovingAverage</code> | |
24+
| [overall\_metric](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.overall_metric.md) | <code>ExpressionFunctionOverallMetric</code> | |
2425
| [theme](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.theme.md) | <code>ExpressionFunctionTheme</code> | |
2526
| [var\_set](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.var_set.md) | <code>ExpressionFunctionVarSet</code> | |
2627
| [var](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.var.md) | <code>ExpressionFunctionVar</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-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExpressionFunctionDefinitions](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.md) &gt; [overall\_metric](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.overall_metric.md)
4+
5+
## ExpressionFunctionDefinitions.overall\_metric property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
overall_metric: ExpressionFunctionOverallMetric;
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
@@ -21,6 +21,7 @@ export interface ExpressionFunctionDefinitions
2121
| [derivative](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.derivative.md) | <code>ExpressionFunctionDerivative</code> | |
2222
| [font](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.font.md) | <code>ExpressionFunctionFont</code> | |
2323
| [moving\_average](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.moving_average.md) | <code>ExpressionFunctionMovingAverage</code> | |
24+
| [overall\_metric](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.overall_metric.md) | <code>ExpressionFunctionOverallMetric</code> | |
2425
| [theme](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.theme.md) | <code>ExpressionFunctionTheme</code> | |
2526
| [var\_set](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.var_set.md) | <code>ExpressionFunctionVarSet</code> | |
2627
| [var](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.var.md) | <code>ExpressionFunctionVar</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; [overall\_metric](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.overall_metric.md)
4+
5+
## ExpressionFunctionDefinitions.overall\_metric property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
overall_metric: ExpressionFunctionOverallMetric;
11+
```

docs/discover/search-sessions.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,19 @@ behaves differently:
6868
* Relative dates are converted to absolute dates.
6969
* Panning and zooming is disabled for maps.
7070
* Changing a filter, query, or drilldown starts a new search session, which can be slow.
71+
72+
[float]
73+
==== Limitations
74+
75+
Certain visualization features do not fully support background search sessions yet. If a dashboard using these features gets restored,
76+
all panels using unsupported features won't load immediately, but instead send out additional data requests which can take a while to complete.
77+
In this case a warning *Your search session is still running* will be shown.
78+
79+
You can either wait for these additional requests to complete or come back to the dashboard later when all data requests have been finished.
80+
81+
A panel on a dashboard can behave like this if one of the following features is used:
82+
* *Lens* - A *top values* dimension with an enabled setting *Group other values as "Other"* (configurable in the *Advanced* section of the dimension)
83+
* *Lens* - An *intervals* dimension is used
84+
* *Aggregation based* visualizations - A *terms* aggregation is used with an enabled setting *Group other values in separate bucket*
85+
* *Aggregation based* visualizations - A *histogram* aggregation is used
86+
* *Maps* - Layers using joins, blended layers or tracks layers are used

docs/user/alerting/domain-specific-rules.asciidoc

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

0 commit comments

Comments
 (0)