Skip to content

Commit

Permalink
Merge branch 'master' into rk/82755-profile-links
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Mar 1, 2021
2 parents 1ebd481 + 1a77095 commit a896248
Show file tree
Hide file tree
Showing 923 changed files with 25,072 additions and 4,154,775 deletions.
2 changes: 1 addition & 1 deletion .bazeliskversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.3
1.7.5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.aws-config.json
.signing-config.json
/api_docs
.ackrc
/.es
/.chromium
Expand Down
9 changes: 0 additions & 9 deletions .telemetryrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
{
"output": "src/plugins/telemetry/schema/oss_plugins.json",
"root": "src/plugins/",
"exclude": [
"src/plugins/kibana_react/",
"src/plugins/testbed/",
"src/plugins/kibana_utils/"
]
},
{
"output": "src/plugins/telemetry/schema/legacy_plugins.json",
"root": "src/legacy/server/",
"exclude": []
}
]
19 changes: 18 additions & 1 deletion docs/canvas/canvas-function-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,16 @@ Aliases: `column`, `name`
Aliases: `exp`, `fn`, `function`
|`boolean`, `number`, `string`, `null`
|A Canvas expression that is passed to each row as a single row `datatable`.

|`id`

|`string`, `null`
|An optional id of the resulting column. When not specified or `null` the name argument is used as id.

|`copyMetaFrom`

|`string`, `null`
|If set, the meta object from the specified column id is copied over to the specified target column. Throws an exception if the column doesn't exist
|===

*Returns:* `datatable`
Expand Down Expand Up @@ -1755,9 +1765,16 @@ Interprets a `TinyMath` math expression using a `number` or `datatable` as _cont
Alias: `expression`
|`string`
|An evaluated `TinyMath` expression. See https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html.

|`onError`

|`string`
|In case the `TinyMath` evaluation fails or returns NaN, the return value is specified by onError. For example, `"null"`, `"zero"`, `"false"`, `"throw"`. When `"throw"`, it will throw an exception, terminating expression execution.

Default: `"throw"`
|===

*Returns:* `number`
*Returns:* `number` | `boolean` | `null`


[float]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<b>Signature:</b>

```typescript
export declare type AppenderConfigType = ConsoleAppenderConfig | FileAppenderConfig | LegacyAppenderConfig | RollingFileAppenderConfig;
export declare type AppenderConfigType = ConsoleAppenderConfig | FileAppenderConfig | LegacyAppenderConfig | RewriteAppenderConfig | RollingFileAppenderConfig;
```
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Should never be used in code outside of Core but is exported for documentation p
| [requiredBundles](./kibana-plugin-core-server.pluginmanifest.requiredbundles.md) | <code>readonly string[]</code> | List of plugin ids that this plugin's UI code imports modules from that are not in <code>requiredPlugins</code>. |
| [requiredPlugins](./kibana-plugin-core-server.pluginmanifest.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |
| [server](./kibana-plugin-core-server.pluginmanifest.server.md) | <code>boolean</code> | Specifies whether plugin includes some server-side specific functionality. |
| [serviceFolders](./kibana-plugin-core-server.pluginmanifest.servicefolders.md) | <code>readonly string[]</code> | Only used for the automatically generated API documentation. Specifying service folders will cause your plugin API reference to be broken up into sub sections. |
| [ui](./kibana-plugin-core-server.pluginmanifest.ui.md) | <code>boolean</code> | Specifies whether plugin includes some client/browser specific functionality that should be included into client bundle via <code>public/ui_plugin.js</code> file. |
| [version](./kibana-plugin-core-server.pluginmanifest.version.md) | <code>string</code> | Version of the plugin. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) &gt; [serviceFolders](./kibana-plugin-core-server.pluginmanifest.servicefolders.md)

## PluginManifest.serviceFolders property

Only used for the automatically generated API documentation. Specifying service folders will cause your plugin API reference to be broken up into sub sections.

<b>Signature:</b>

```typescript
readonly serviceFolders?: readonly string[];
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export declare type IndexPatternSelectProps = Required<Omit<EuiComboBoxProps<any
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions docs/discover/search-for-relevance.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[[discover-search-for-relevance]]
== Search for relevance
Sometimes you might be unsure which documents best match your question.
{es} assigns a relevancy, or score to each document, so you can
can narrow your search to the documents with the most relevant results.
The higher the score, the better it matches your query.

For example, suppose you have the <<gs-get-data-into-kibana, sample flights data set>>, and you're a searching for
a flight that arrived or departed from `Warsaw` or `Venice` when the weather was clear.

. In *Discover*, open the index pattern dropdown, and select `kibana_sample_data_flight`.
. In the query bar, click *KQL*, and switch to the <<lucene-query, Lucene query syntax>>.
. Search for `Warsaw OR Venice OR Clear`.
. If you don't see any results, open the time filter and select a time range that contains data.
. From the list of *Available fields*, add `_score` to the document table.
. In the document table, click the header for the `_score` column, and then sort the column by descending scores.
+
The results are currently sorted by first `Time`, and then by `_score`.
. To sort only by `_score`, remove the `Time` field.
+
Your table now shows documents with the best matches, from most to least relevant.
+
[role="screenshot"]
image::images/discover-search-for-relevance.png["Example of a search for relevance"]
4 changes: 2 additions & 2 deletions docs/user/alerting/action-types/pagerduty.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ See <<pagerduty-in-pagerduty, In PagerDuty>> for how to obtain the endpoint and
+
* The action’s type: Trigger, Resolve, or Acknowledge.
* The event’s severity: Info, warning, error, or critical.
* An array of different fields, including the timestamp, group, class, component, and your dedup key.
* An array of different fields, including the timestamp, group, class, component, and your dedup key. By default, the dedup is configured to create a new PagerDuty incident for each alert instance and reuse the incident when a recovered alert instance reactivates.
Depending on your custom needs, assign them variables from the alerting context.
To see the available context variables, click on the *Add alert variable* icon next
to each corresponding field. For more details on these parameters, see the
Expand Down Expand Up @@ -179,7 +179,7 @@ PagerDuty actions have the following properties:

Severity:: The perceived severity of on the affected system. This can be one of `Critical`, `Error`, `Warning` or `Info`(default).
Event action:: One of `Trigger` (default), `Resolve`, or `Acknowledge`. See https://v2.developer.pagerduty.com/docs/events-api-v2#event-action[event action] for more details.
Dedup Key:: All actions sharing this key will be associated with the same PagerDuty alert. This value is used to correlate trigger and resolution. This value is *optional*, and if unset defaults to `action:<action saved object id>`. The maximum length is *255* characters. See https://v2.developer.pagerduty.com/docs/events-api-v2#alert-de-duplication[alert deduplication] for details.
Dedup Key:: All actions sharing this key will be associated with the same PagerDuty alert. This value is used to correlate trigger and resolution. This value is *optional*, and if not set, defaults to `<alert ID>:<alert instance ID>`. The maximum length is *255* characters. See https://v2.developer.pagerduty.com/docs/events-api-v2#alert-de-duplication[alert deduplication] for details.
Timestamp:: An *optional* https://v2.developer.pagerduty.com/v2/docs/types#datetime[ISO-8601 format date-time], indicating the time the event was detected or generated.
Component:: An *optional* value indicating the component of the source machine that is responsible for the event, for example `mysql` or `eth0`.
Group:: An *optional* value indicating the logical grouping of components of a service, for example `app-stack`.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/alerting/alert-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ For domain-specific alerts, refer to the documentation for that app.
* <<geo-alerting, Maps alerts>>
* <<xpack-ml, ML alerts>>

[NOTE]
==============================================
Some alert types are subscription features, while others are free features.
For a comparison of the Elastic subscription levels,
see {subscriptions}[the subscription page].
==============================================


include::stack-alerts/index-threshold.asciidoc[]
include::stack-alerts/es-query.asciidoc[]
include::maps-alerts/geo-alert-types.asciidoc[]
4 changes: 2 additions & 2 deletions docs/user/dashboard/drilldowns.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ that shows a single data center or server.
[[url-drilldowns]]
==== URL drilldowns

beta[] URL drilldowns enable you to navigate from a dashboard to internal or external URLs.
URL drilldowns enable you to navigate from a dashboard to internal or external URLs.
Destination URLs can be dynamic, depending on the dashboard context or user interaction with a panel.
For example, if you have a dashboard that shows data from a Github repository, you can create a URL drilldown
that opens Github from the dashboard.
Expand Down Expand Up @@ -226,7 +226,7 @@ and date range are carried over.
[[create-a-url-drilldown]]
=== Try it: Create a URL drilldown

beta[] To create URL drilldowns, you add <<variables,variables>> to a URL template, which configures the bahavior of the drilldown.
To create URL drilldowns, you add <<variables,variables>> to a URL template, which configures the behavior of the drilldown.

image:images/url_drilldown_go_to_github.gif[Drilldown on pie chart that navigates to Github]

Expand Down
5 changes: 4 additions & 1 deletion docs/user/discover.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ image:images/visualize-from-discover.png[Visualization that opens from Discover
[float]
=== What’s next?


* <<kuery-query, Learn more about the structure of a KQL query>>.

* <<kibana-discover-settings, Configure Discover>> to better meet your needs.
Expand All @@ -209,10 +208,14 @@ the table columns that display by default, and more.

* <<reporting-getting-started, Present your findings in a report>>.

* <<discover-search-for-relevance, Search for relevance>>.

--

include::{kib-repo-dir}/management/index-patterns.asciidoc[]

include::{kib-repo-dir}/discover/set-time-filter.asciidoc[]

include::{kib-repo-dir}/discover/search.asciidoc[]

include::{kib-repo-dir}/discover/search-for-relevance.asciidoc[]
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"test:ftr:runner": "node scripts/functional_test_runner",
"checkLicenses": "node scripts/check_licenses --dev",
"build": "node scripts/build --all-platforms",
"build:apidocs": "node scripts/build_api_docs",
"start": "node scripts/kibana --dev",
"debug": "node --nolazy --inspect scripts/kibana --dev",
"debug-break": "node --nolazy --inspect-brk scripts/kibana --dev",
Expand Down Expand Up @@ -367,7 +368,7 @@
"@kbn/plugin-generator": "link:packages/kbn-plugin-generator",
"@kbn/plugin-helpers": "link:packages/kbn-plugin-helpers",
"@kbn/pm": "link:packages/kbn-pm",
"@kbn/release-notes": "link:packages/kbn-release-notes",
"@kbn/docs-utils": "link:packages/kbn-docs-utils",
"@kbn/storybook": "link:packages/kbn-storybook",
"@kbn/telemetry-tools": "link:packages/kbn-telemetry-tools",
"@kbn/test": "link:packages/kbn-test",
Expand Down Expand Up @@ -654,6 +655,7 @@
"fetch-mock": "^7.3.9",
"file-loader": "^4.2.0",
"file-saver": "^1.3.8",
"form-data": "^4.0.0",
"formsy-react": "^1.1.5",
"geckodriver": "^1.21.0",
"glob-watcher": "5.0.3",
Expand Down Expand Up @@ -821,6 +823,7 @@
"tinycolor2": "1.4.1",
"topojson-client": "3.0.0",
"ts-loader": "^7.0.5",
"ts-morph": "^9.1.0",
"tsd": "^0.13.1",
"typescript": "4.1.3",
"typescript-fsa": "^3.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-dev-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export {
KBN_P12_PATH,
KBN_P12_PASSWORD,
} from './certs';
export * from './kbn_client';
export * from './run';
export * from './axios';
export * from './stdio';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface Manifest {
server: boolean;
kibanaVersion: string;
version: string;
serviceFolders: readonly string[];
requiredPlugins: readonly string[];
optionalPlugins: readonly string[];
requiredBundles: readonly string[];
Expand Down Expand Up @@ -64,6 +65,7 @@ export function parseKibanaPlatformPlugin(manifestPath: string): KibanaPlatformP
id: manifest.id,
version: manifest.version,
kibanaVersion: manifest.kibanaVersion || manifest.version,
serviceFolders: manifest.serviceFolders || [],
requiredPlugins: isValidDepsDeclaration(manifest.requiredPlugins, 'requiredPlugins'),
optionalPlugins: isValidDepsDeclaration(manifest.optionalPlugins, 'optionalPlugins'),
requiredBundles: isValidDepsDeclaration(manifest.requiredBundles, 'requiredBundles'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-release-notes'],
roots: ['<rootDir>/packages/kbn-docs-utils'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@kbn/release-notes",
"name": "@kbn/docs-utils",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": "true",
Expand All @@ -13,6 +13,7 @@
},
"dependencies": {
"@kbn/utils": "link:../kbn-utils",
"@kbn/config": "link:../kbn-config",
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}
12 changes: 12 additions & 0 deletions packages/kbn-docs-utils/src/api_docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Autogenerated API documentation

[RFC](../../../rfcs/text/0014_api_documentation.md)

This is an experimental api documentation system that is managed by the Kibana Tech Leads until
we determine the value of such a system and what kind of maintenance burder it will incur.

To generate the docs run

```
node scripts/build_api_docs
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import Path from 'path';
import { Project, Node } from 'ts-morph';
import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils';

import { TypeKind, ApiScope } from '../types';
import { getKibanaPlatformPlugin } from '../tests/kibana_platform_plugin_mock';
import { getDeclarationNodesForPluginScope } from '../get_declaration_nodes_for_plugin';
import { buildApiDeclaration } from './build_api_declaration';
import { isNamedNode } from '../tsmorph_utils';

const log = new ToolingLog({
level: 'debug',
writeTo: process.stdout,
});

let nodes: Node[];
let plugins: KibanaPlatformPlugin[];

function getNodeName(node: Node): string {
return isNamedNode(node) ? node.getName() : '';
}

beforeAll(() => {
const tsConfigFilePath = Path.resolve(__dirname, '../tests/__fixtures__/src/tsconfig.json');
const project = new Project({
tsConfigFilePath,
});

plugins = [getKibanaPlatformPlugin('pluginA')];

nodes = getDeclarationNodesForPluginScope(project, plugins[0], ApiScope.CLIENT, log);
});

it('Test number primitive doc def', () => {
const node = nodes.find((n) => getNodeName(n) === 'aNum');
expect(node).toBeDefined();
const def = buildApiDeclaration(node!, plugins, log, plugins[0].manifest.id, ApiScope.CLIENT);

expect(def.type).toBe(TypeKind.NumberKind);
});

it('Function type is exported as type with signature', () => {
const node = nodes.find((n) => getNodeName(n) === 'FnWithGeneric');
expect(node).toBeDefined();
const def = buildApiDeclaration(node!, plugins, log, plugins[0].manifest.id, ApiScope.CLIENT);
expect(def).toBeDefined();
expect(def?.type).toBe(TypeKind.TypeKind);
expect(def?.signature?.length).toBeGreaterThan(0);
});

it('Test Interface Kind doc def', () => {
const node = nodes.find((n) => getNodeName(n) === 'ExampleInterface');
expect(node).toBeDefined();
const def = buildApiDeclaration(node!, plugins, log, plugins[0].manifest.id, ApiScope.CLIENT);

expect(def.type).toBe(TypeKind.InterfaceKind);
expect(def.children).toBeDefined();
expect(def.children!.length).toBe(3);
});

it('Test union export', () => {
const node = nodes.find((n) => getNodeName(n) === 'aUnionProperty');
expect(node).toBeDefined();
const def = buildApiDeclaration(node!, plugins, log, plugins[0].manifest.id, ApiScope.CLIENT);
expect(def.type).toBe(TypeKind.CompoundTypeKind);
});

it('Function inside interface has a label', () => {
const node = nodes.find((n) => getNodeName(n) === 'ExampleInterface');
expect(node).toBeDefined();
const def = buildApiDeclaration(node!, plugins, log, plugins[0].manifest.id, ApiScope.CLIENT);

const fn = def!.children?.find((c) => c.label === 'aFn');
expect(fn).toBeDefined();
expect(fn?.label).toBe('aFn');
expect(fn?.type).toBe(TypeKind.FunctionKind);
});
Loading

0 comments on commit a896248

Please sign in to comment.