Skip to content

Commit

Permalink
Merge remote-tracking branch 'elastic/master' into reporting/telemetr…
Browse files Browse the repository at this point in the history
…y-add-reports-stats
  • Loading branch information
tsullivan committed Sep 23, 2021
2 parents 867bcb9 + 884165a commit 2fedbbe
Show file tree
Hide file tree
Showing 333 changed files with 5,026 additions and 2,293 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@
#CC# /x-pack/plugins/security_solution/ @elastic/security-solution

# Security Solution sub teams
/x-pack/plugins/cases @elastic/security-threat-hunting-cases
/x-pack/plugins/cases @elastic/security-threat-hunting
/x-pack/plugins/timelines @elastic/security-threat-hunting
/x-pack/test/case_api_integration @elastic/security-threat-hunting-cases
/x-pack/test/case_api_integration @elastic/security-threat-hunting
/x-pack/plugins/lists @elastic/security-detections-response

## Security Solution sub teams - security-onboarding-and-lifecycle-mgt
Expand Down
4 changes: 2 additions & 2 deletions dev_docs/key_concepts/persistable_state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ tags: ['kibana','dev', 'contributor', 'api docs']

## Exposing state that can be persisted

Any plugin that exposes state that another plugin might persist should implement <DocLink id="kibKibanaUtilsPluginApi " section="def-common.PersistableStateService" text="`PersistableStateService`"/> interface on their `setup` contract. This will allow plugins persisting the state to easily access migrations and other utilities.
Any plugin that exposes state that another plugin might persist should implement <DocLink id="kibKibanaUtilsPluginApi" section="def-common.PersistableStateService" text="`PersistableStateService`"/> interface on their `setup` contract. This will allow plugins persisting the state to easily access migrations and other utilities.

Example: Data plugin allows you to generate filters. Those filters can be persisted by applications in their saved
objects or in the URL. In order to allow apps to migrate the filters in case the structure changes in the future, the Data plugin implements `PersistableStateService` on <DocLink id="kibDataQueryPluginApi " section="def-public.FilterManager" text="`data.query.filterManager`"/>.
objects or in the URL. In order to allow apps to migrate the filters in case the structure changes in the future, the Data plugin implements `PersistableStateService` on <DocLink id="kibDataQueryPluginApi" section="def-public.FilterManager" text="`data.query.filterManager`"/>.

note: There is currently no obvious way for a plugin to know which state is safe to persist. The developer must manually look for a matching `PersistableStateService`, or ad-hoc provided migration utilities (as is the case with Rule Type Parameters).
In the future, we hope to make it easier for producers of state to understand when they need to write a migration with changes, and also make it easier for consumers of such state, to understand whether it is safe to persist.
Expand Down
1 change: 1 addition & 0 deletions docs/dev-tools/console/console.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ shortcuts, click *Help*.
[[console-settings]]
=== Disable Console

deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
If you don’t want to use *Console*, you can disable it by setting `console.enabled`
to `false` in your `kibana.yml` configuration file. Changing this setting
causes the server to regenerate assets on the next startup,
Expand Down
3 changes: 3 additions & 0 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ The default placeholder value to use in
Fields that exist outside of `_source`. Kibana merges these fields into the
document when displaying it.

[[metrics:allowStringIndices]]`metrics:allowStringIndices`::
Enables you to use {es} indices in *TSVB* visualizations.

[[metrics-maxbuckets]]`metrics:max_buckets`::
Affects the *TSVB* histogram density. Must be set higher than `histogram:maxBars`.

Expand Down
1 change: 1 addition & 0 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Be sure to back up the encryption key value somewhere safe, as your alerting rul
==== Action settings

`xpack.actions.enabled`::
deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Feature toggle that enables Actions in {kib}.
If `false`, all features dependent on Actions are disabled, including the *Observability* and *Security* apps. Default: `true`.

Expand Down
3 changes: 2 additions & 1 deletion docs/settings/apm-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ Changing these settings may disable features of the APM App.
[cols="2*<"]
|===
| `xpack.apm.enabled`
| Set to `false` to disable the APM app. Defaults to `true`.
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `false` to disable the APM app. Defaults to `true`.

| `xpack.apm.maxServiceEnvironments`
| Maximum number of unique service environments recognized by the UI. Defaults to `100`.
Expand Down
3 changes: 3 additions & 0 deletions docs/settings/dev-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ They are enabled by default.
==== Grok Debugger settings

`xpack.grokdebugger.enabled` {ess-icon}::
deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `true` to enable the <<xpack-grokdebugger,Grok Debugger>>. Defaults to `true`.


Expand All @@ -21,11 +22,13 @@ Set to `true` to enable the <<xpack-grokdebugger,Grok Debugger>>. Defaults to `t
==== {searchprofiler} settings

`xpack.searchprofiler.enabled`::
deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `true` to enable the <<xpack-profiler,{searchprofiler}>>. Defaults to `true`.

[float]
[[painless_lab-settings]]
==== Painless Lab settings

`xpack.painless_lab.enabled`::
deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
When set to `true`, enables the <<painlesslab, Painless Lab>>. Defaults to `true`.
3 changes: 2 additions & 1 deletion docs/settings/fleet-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ See the {fleet-guide}/index.html[{fleet}] docs for more information.
[cols="2*<"]
|===
| `xpack.fleet.enabled` {ess-icon}
| Set to `true` (default) to enable {fleet}.
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `true` (default) to enable {fleet}.
| `xpack.fleet.agents.enabled` {ess-icon}
| Set to `true` (default) to enable {fleet}.
|===
Expand Down
3 changes: 2 additions & 1 deletion docs/settings/general-infra-logs-ui-settings.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[cols="2*<"]
|===
| `xpack.infra.enabled`
| Set to `false` to disable the Logs and Metrics app plugin {kib}. Defaults to `true`.
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `false` to disable the Logs and Metrics app plugin {kib}. Defaults to `true`.

| `xpack.infra.sources.default.logAlias`
| Index pattern for matching indices that contain log data. Defaults to `filebeat-*,kibana_sample_data_logs*`. To match multiple wildcard patterns, use a comma to separate the names, with no space after the comma. For example, `logstash-app1-*,default-logs-*`.
Expand Down
1 change: 1 addition & 0 deletions docs/settings/graph-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
You do not need to configure any settings to use the {graph-features}.

`xpack.graph.enabled` {ess-icon}::
deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `false` to disable the {graph-features}.
3 changes: 2 additions & 1 deletion docs/settings/ml-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ enabled by default.
[cols="2*<"]
|===
| `xpack.ml.enabled` {ess-icon}
| Set to `true` (default) to enable {kib} {ml-features}. +
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `true` (default) to enable {kib} {ml-features}. +
+
If set to `false` in `kibana.yml`, the {ml} icon is hidden in this {kib}
instance. If `xpack.ml.enabled` is set to `true` in `elasticsearch.yml`, however,
Expand Down
3 changes: 2 additions & 1 deletion docs/settings/monitoring-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ For more information, see
[cols="2*<"]
|===
| `monitoring.enabled`
| Set to `true` (default) to enable the {monitor-features} in {kib}. Unlike the
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `true` (default) to enable the {monitor-features} in {kib}. Unlike the
<<monitoring-ui-enabled, `monitoring.ui.enabled`>> setting, when this setting is `false`, the
monitoring back-end does not run and {kib} stats are not sent to the monitoring
cluster.
Expand Down
3 changes: 2 additions & 1 deletion docs/settings/security-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ You do not need to configure any additional settings to use the
[cols="2*<"]
|===
| `xpack.security.enabled`
| By default, {kib} automatically detects whether to enable the
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
By default, {kib} automatically detects whether to enable the
{security-features} based on the license and whether {es} {security-features}
are enabled. +
+
Expand Down
5 changes: 3 additions & 2 deletions docs/settings/spaces-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ roles when Security is enabled.
[cols="2*<"]
|===
| `xpack.spaces.enabled`
| Set to `true` (default) to enable Spaces in {kib}.
This setting is deprecated. Starting in 8.0, it will not be possible to disable this plugin.
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set to `true` (default) to enable Spaces in {kib}.
This setting is deprecated. Starting in 8.0, it will not be possible to disable this plugin.

| `xpack.spaces.maxSpaces`
| The maximum amount of Spaces that can be used with this instance of {kib}. Some operations
Expand Down
3 changes: 2 additions & 1 deletion docs/settings/url-drilldown-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Configure the URL drilldown settings in your `kibana.yml` configuration file.
[cols="2*<"]
|===
| [[url-drilldown-enabled]] `url_drilldown.enabled`
| When `true`, enables URL drilldowns on your {kib} instance.
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
When `true`, enables URL drilldowns on your {kib} instance.

| [[external-URL-policy]] `externalUrl.policy`
| Configures the external URL policies. URL drilldowns respect the global *External URL* service, which you can use to deny or allow external URLs.
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Some example translations are shown here:
**Environment Variable**:: **Kibana Setting**
`SERVER_NAME`:: `server.name`
`SERVER_BASEPATH`:: `server.basePath`
`MONITORING_ENABLED`:: `monitoring.enabled`
`ELASTICSEARCH_HOSTS`:: `elasticsearch.hosts`

In general, any setting listed in <<settings>> can be configured with this technique.

Expand Down
12 changes: 7 additions & 5 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ configuration using `${MY_ENV_VAR}` syntax.
|===

| `console.enabled:`
| Toggling this causes the server to regenerate assets on the next startup,
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Toggling this causes the server to regenerate assets on the next startup,
which may cause a delay before pages start being served.
Set to `false` to disable Console. *Default: `true`*

Expand Down Expand Up @@ -706,12 +707,13 @@ sources and images. When false, Vega can only get data from {es}. *Default: `fal
| Enables you to view the underlying documents in a data series from a dashboard panel. *Default: `false`*

| `xpack.license_management.enabled`
| Set this value to false to
disable the License Management UI. *Default: `true`*
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set this value to false to disable the License Management UI.
*Default: `true`*

| `xpack.rollup.enabled:`
| Set this value to false to disable the
Rollup UI. *Default: true*
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
Set this value to false to disable the Rollup UI. *Default: true*

| `i18n.locale` {ess-icon}
| Set this value to change the {kib} interface language.
Expand Down
Binary file modified docs/user/dashboard/images/tsvb_index_pattern_selection_mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/user/dashboard/tsvb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ When you use only {data-sources}, you are able to:

* Improve performance

IMPORTANT: Creating *TSVB* visualizations with an {es} index string is deprecated and will be removed in a future release.
It is the default one for new visualizations but it can also be switched for the old implementations:
IMPORTANT: Creating *TSVB* visualizations with an {es} index string is deprecated. To use an {es} index string, contact your administrator, or go to <<advanced-options, Advanced Settings>> and set `metrics:allowStringIndices` to `true`. Creating *TSVB* visualizations with an {es} index string will be removed in a future release.
Creating visualizations with only {data-sources} is the default one for new visualizations but it can also be switched for the old implementations:

. Click *Panel options*, then open the *Index pattern selection mode* options next to the *Index pattern* dropdown.

Expand Down
2 changes: 2 additions & 0 deletions docs/user/dashboard/vega-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Tokens include the following:
* `"%dashboard_context-filter_clause%"`: String replaced by an object containing filters
* `"%dashboard_context-must_not_clause%"`: String replaced by an object containing filters

NOTE: Vega supports the `interval` parameter, which is unsupported {es} 8.0.0 and later. To use intervals, use `fixed_interval` or `calendar_interval` instead.

For example, the following query counts the number of documents in a specific index:

[source,yaml]
Expand Down
4 changes: 3 additions & 1 deletion docs/user/plugins.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ NOTE: Removing a plugin will result in an "optimize" run which will delay the ne
[[disable-plugin]]
== Disable plugins

deprecated:[7.16.0,"In 8.0 and later, this setting will only be supported for a subset of plugins that have opted in to the behavior."]

Use the following command to disable a plugin:

[source,shell]
Expand All @@ -158,7 +160,7 @@ Use the following command to disable a plugin:

NOTE: Disabling or enabling a plugin will result in an "optimize" run which will delay the start of {kib}.

<1> You can find a plugin's plugin ID as the value of the `name` property in the plugin's `package.json` file.
<1> You can find a plugin's plugin ID as the value of the `name` property in the plugin's `kibana.json` file.

[float]
[[configure-plugin-manager]]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@
"callsites": "^3.1.0",
"chai": "3.5.0",
"chance": "1.0.18",
"chromedriver": "^92.0.1",
"chromedriver": "^93.0.1",
"clean-webpack-plugin": "^3.0.0",
"cmd-shim": "^2.1.0",
"compression-webpack-plugin": "^4.0.0",
Expand Down
31 changes: 31 additions & 0 deletions packages/kbn-config/src/config_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,37 @@ test('read "enabled" even if its schema is not present', async () => {
expect(isEnabled).toBe(true);
});

test('logs deprecation if schema is not present and "enabled" is used', async () => {
const initialConfig = {
foo: {
enabled: true,
},
};

const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig });
const configService = new ConfigService(rawConfigProvider, defaultEnv, logger);

await configService.isEnabledAtPath('foo');
expect(configService.getHandledDeprecatedConfigs()).toMatchInlineSnapshot(`
Array [
Array [
"foo",
Array [
Object {
"correctiveActions": Object {
"manualSteps": Array [
"Remove \\"foo.enabled\\" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.",
],
},
"message": "Configuring \\"foo.enabled\\" is deprecated and will be removed in 8.0.0.",
"title": "Setting \\"foo.enabled\\" is deprecated",
},
],
],
]
`);
});

test('allows plugins to specify "enabled" flag via validation schema', async () => {
const initialConfig = {};

Expand Down
27 changes: 24 additions & 3 deletions packages/kbn-config/src/config_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,23 @@ export class ConfigService {
// if plugin hasn't got a config schema, we try to read "enabled" directly
const isEnabled = validatedConfig?.enabled ?? config.get(enabledPath);

// if we implicitly added an `enabled` config to a plugin without a schema,
// we log a deprecation warning, as this will not be supported in 8.0
if (validatedConfig?.enabled === undefined && isEnabled !== undefined) {
const deprecationPath = pathToString(enabledPath);
const deprecatedConfigDetails: DeprecatedConfigDetails = {
title: `Setting "${deprecationPath}" is deprecated`,
message: `Configuring "${deprecationPath}" is deprecated and will be removed in 8.0.0.`,
correctiveActions: {
manualSteps: [
`Remove "${deprecationPath}" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.`,
],
},
};
this.deprecationLog.warn(deprecatedConfigDetails.message);
this.markDeprecatedConfigAsHandled(namespace, deprecatedConfigDetails);
}

// not declared. consider that plugin is enabled by default
if (isEnabled === undefined) {
return true;
Expand Down Expand Up @@ -220,9 +237,7 @@ export class ConfigService {
if (!context.silent) {
deprecationMessages.push(context.message);
}
const handledDeprecatedConfig = this.handledDeprecatedConfigs.get(domainId) || [];
handledDeprecatedConfig.push(context);
this.handledDeprecatedConfigs.set(domainId, handledDeprecatedConfig);
this.markDeprecatedConfigAsHandled(domainId, context);
};

applyDeprecations(rawConfig, deprecations, createAddDeprecation);
Expand Down Expand Up @@ -260,6 +275,12 @@ export class ConfigService {
this.log.debug(`Marking config path as handled: ${path}`);
this.handledPaths.add(path);
}

private markDeprecatedConfigAsHandled(domainId: string, config: DeprecatedConfigDetails) {
const handledDeprecatedConfig = this.handledDeprecatedConfigs.get(domainId) || [];
handledDeprecatedConfig.push(config);
this.handledDeprecatedConfigs.set(domainId, handledDeprecatedConfig);
}
}

const createPluginEnabledPath = (configPath: string | string[]) => {
Expand Down
Loading

0 comments on commit 2fedbbe

Please sign in to comment.