Skip to content

Commit

Permalink
Merge branch '7.x' into deprecated-sub-feature-cases-7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 14, 2021
2 parents a645e1b + 099c691 commit 8e88366
Show file tree
Hide file tree
Showing 560 changed files with 10,399 additions and 10,780 deletions.
23 changes: 19 additions & 4 deletions dev_docs/key_concepts/kibana_platform_plugin_intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,28 @@ At a super high-level, Kibana is composed of **plugins**, **core**, and **Kibana

<DocAccordion buttonContent="(Internal only) FAQ: Should I put my code in a plugin or a package?" color="warning">
<DocCallOut color="warning">
If it's stateful, it has to go in a plugin, but packages are often a good choices for stateless utilities. Stateless code exported publicly from a plugin will increase the page load bundle size of _every single page_, even if none of those plugin's services are actually needed. With packages, however, only code that is needed for the current page is downloaded.
When the [Bazel migration](https://github.com/elastic/kibana/blob/master/legacy_rfcs/text/0015_bazel.md) is complete, all code, including plugins, will be a package. With that, packages won't be required to be in the `packages/` directory and can be located somewhere that makes more sense structurally.

The downside however is that the packages folder is far away from the plugins folder so having a part of your code in a plugin and the rest in a package may make it hard to find, leading to duplication.
In the meantime, the following can be used to determine whether it makes sense to add code to a package inside the `packages` folder, or a plugin inside `src/plugins` or `x-pack/plugins`.

The Operations team hopes to resolve this conundrum by supporting co-located packages and plugins and automatically putting all stateless code inside a package. You can track this work by following [this issue](https://github.com/elastic/kibana/issues/112886).

Until then, consider whether it makes sense to logically separate the code, and consider the size of the exports, when determining whether you should put stateless public exports in a package or a plugin.
**If the code is stateful, it has to be exposed from a plugin's <DocLink id="kibPlatformIntro" section="lifecycle-methods" text="lifecycle methods"/>. Do not statically export stateful code.**

Benefits to packages:

1. <b>_Potentially_ reduced page load time</b>. All code that is statically exported from plugins will be downloaded on _every single page load_, even if that code isn't needed. With packages, only code that is imported is downloaded, which can be minimized by using async imports.
2. <b>Puts the consumer is in charge of how and when to async import</b>. If a consumer async imports code exported from a plugin, it makes no difference, because of the above point. It's already been downloaded. However, simply moving code into a package is _not_ a guaranteed performance improvement. It does give the consumer the power to make smart performance choices, however. If they require code from multiple packages, the consumer can async import from multiple packages at the same time. Read more in our <DocLink id="kibDevPerformance" text="performance docs"/>.

Downsides to packages:

1. <b>It's not <DocLink id="kibDevPrinciples" text="organized by domain"/></b>. The packages folder is far away from the plugins folder. Having your stateless code in a plugin and the rest in a package may make it hard to find, leading to duplication. The Operations team hopes to fix this by supporting packages and plugins existing in the same folder. You can track this work by following [this issue](https://github.com/elastic/kibana/issues/112886).

2. <b>Development overhead</b>. Developers have to run `yarn kbn watch` to have changes rebuilt automatically. [Phase II](https://github.com/elastic/kibana/blob/master/legacy_rfcs/text/0015_bazel.md#phase-ii---docs-developer-experience) of the Bazel migration work will bring the development experience on par with plugin development. This work can be tracked [here](https://github.com/elastic/kibana/issues/104519).

3. <b>Development performance</b>. Rebuild time is typically longer than it would be for the same code in a plugin. The reasons are captured in [this issue](https://github.com/elastic/kibana/issues/107648). The ops team is actively working to reduce this performance increase.


As you can see, the answer to "Should I put my code in a plugin or a package" is 'It Depends'. If you are still having a hard time determining what the best path location is, reach out to the Kibana Operations Team (#kibana-operations) for help.

</DocCallOut>
</DocAccordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ experimental[] Create a centrally-managed Logstash pipeline, or update an existi
(Required, string) The pipeline definition.

`settings`::
(Optional, object) The pipeline settings. Supported settings, represented as object keys, are `pipeline.workers`, `pipeline.batch.size`, `pipeline.batch.delay`, `queue.type`, `queue.max_bytes`, and `queue.checkpoint.writes`.
(Optional, object) The pipeline settings. Supported settings, represented as object keys, include the following:

* `pipeline.workers`
* `pipeline.batch.size`
* `pipeline.batch.delay`
* `pipeline.ecs_compatibility`
* `pipeline.ordered`
* `queue.type`
* `queue.max_bytes`
* `queue.checkpoint.writes`

[[logstash-configuration-management-api-create-codes]]
==== Response code
Expand Down
2 changes: 1 addition & 1 deletion docs/apm/troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ If you change the default, you must also configure the `setup.template.name` and
See {apm-server-ref}/configuration-template.html[Load the Elasticsearch index template].
If the Elasticsearch index template has already been successfully loaded to the index,
you can customize the indices that the APM app uses to display data.
Navigate to *APM* > *Settings* > *Indices*, and change all `apm_oss.*Pattern` values to
Navigate to *APM* > *Settings* > *Indices*, and change all `xpack.apm.*Pattern` values to
include the new index pattern. For example: `customIndexName-*`.

[float]
Expand Down
4 changes: 0 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ NOTE:
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/apm_oss/README.asciidoc[apmOss]
|undefined
|{kib-repo}blob/{branch}/src/plugins/bfetch/README.md[bfetch]
|bfetch allows to batch HTTP requests and streams responses back.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ readonly links: {
readonly networkMap: string;
readonly troubleshootGaps: string;
};
readonly securitySolution: {
readonly trustedApps: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
Expand Down Expand Up @@ -239,6 +242,7 @@ readonly links: {
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: string;
}>;
readonly ecs: {
readonly guide: string;
Expand Down

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ include::{docs-root}/shared/versions/stack/{source_branch}.asciidoc[]
:blob: {kib-repo}blob/{branch}/
:security-ref: https://www.elastic.co/community/security/

:Data-Sources: Index Patterns
:Data-source: Index pattern
:data-source: index pattern
:Data-sources: Index patterns
:data-sources: index patterns
:A-data-source: An index pattern
:a-data-source: an index pattern

include::{docs-root}/shared/attributes.asciidoc[]
Expand Down
20 changes: 10 additions & 10 deletions docs/settings/apm-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,22 @@ Changing these settings may disable features of the APM App.
| `xpack.apm.agent.migrations.enabled` {ess-icon}
| Set to `false` to disable cloud APM migrations. Defaults to `true`.

| `xpack.apm.errorIndices` {ess-icon}
| Matcher for all {apm-server-ref}/error-indices.html[error indices]. Defaults to `apm-*`.
| `xpack.apm.indices.error` {ess-icon}
| Matcher for all {apm-server-ref}/error-indices.html[error indices]. Defaults to `logs-apm*,apm-*`.

| `xpack.apm.onboardingIndices` {ess-icon}
| `xpack.apm.indices.onboarding` {ess-icon}
| Matcher for all onboarding indices. Defaults to `apm-*`.

| `xpack.apm.spanIndices` {ess-icon}
| Matcher for all {apm-server-ref}/span-indices.html[span indices]. Defaults to `apm-*`.
| `xpack.apm.indices.span` {ess-icon}
| Matcher for all {apm-server-ref}/span-indices.html[span indices]. Defaults to `traces-apm*,apm-*`.

| `xpack.apm.transactionIndices` {ess-icon}
| Matcher for all {apm-server-ref}/transaction-indices.html[transaction indices]. Defaults to `apm-*`.
| `xpack.apm.indices.transaction` {ess-icon}
| Matcher for all {apm-server-ref}/transaction-indices.html[transaction indices]. Defaults to `traces-apm*,apm-*`.

| `xpack.apm.metricsIndices` {ess-icon}
| Matcher for all {apm-server-ref}/metricset-indices.html[metrics indices]. Defaults to `apm-*`.
| `xpack.apm.indices.metric` {ess-icon}
| Matcher for all {apm-server-ref}/metricset-indices.html[metrics indices]. Defaults to `metrics-apm*,apm-*`.

| `xpack.apm.sourcemapIndices` {ess-icon}
| `xpack.apm.indices.sourcemap` {ess-icon}
| Matcher for all {apm-server-ref}/sourcemap-indices.html[source map indices]. Defaults to `apm-*`.

|===
Expand Down
29 changes: 16 additions & 13 deletions docs/settings/spaces-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@
<titleabbrev>Spaces settings</titleabbrev>
++++

By default, Spaces is enabled in Kibana, and you can secure Spaces using
roles when Security is enabled.

[float]
[[spaces-settings]]
==== Spaces settings
By default, spaces is enabled in {kib}. To secure spaces, <<security-settings-kb,enable security>>.

`xpack.spaces.enabled`::
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.
deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported and it will not be possible to disable this plugin."]
To enable spaces, set to `true`.
The default is `true`.

`xpack.spaces.maxSpaces`::
The maximum amount of Spaces that can be used with this instance of {kib}. Some operations
in {kib} return all spaces using a single `_search` from {es}, so this must be
set lower than the `index.max_result_window` in {es}.
Defaults to `1000`.
The maximum number of spaces that you can use with the {kib} instance. Some {kib} operations
return all spaces using a single `_search` from {es}, so you must
configure this setting lower than the `index.max_result_window` in {es}.
The default is `1000`.

`monitoring.cluster_alerts-allowedSpaces` {ess-icon}::
Specifies the spaces where cluster alerts are automatically generated.
You must specify all spaces where you want to generate alerts, including the default space.
When the default space is unspecified, {kib} is unable to generate an alert for the default space.
{es} clusters that run on {es} services are all containers. To send monitoring data
from your self-managed {es} installation to {es} services, set to `false`.
The default is `true`.
4 changes: 2 additions & 2 deletions docs/user/reporting/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

You access the options from the *Share* menu in the toolbar. The sharing options include the following:

* *PDF Reports* &mdash; Generate and download a PDF file of a dashboard, visualization, or *Canvas* workpad.
* *PDF Reports* &mdash; Generate and download a PDF file of a dashboard, visualization, or *Canvas* workpad. PDF reports are a link:https://www.elastic.co/subscriptions[subscription feature].

* *PNG Reports* &mdash; Generate and download a PNG file of a dashboard or visualization.
* *PNG Reports* &mdash; Generate and download a PNG file of a dashboard or visualization. PNG reports are a link:https://www.elastic.co/subscriptions[subscription feature].

* *CSV Reports* &mdash; Generate and download a CSV file of a *Discover* saved search.

Expand Down
3 changes: 1 addition & 2 deletions examples/dashboard_embeddable_examples/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
"githubTeam": "kibana-presentation"
},
"description": "Example app that shows how to embed a dashboard in an application",
"optionalPlugins": [],
"requiredBundles": ["esUiShared"]
"optionalPlugins": []
}
32 changes: 20 additions & 12 deletions examples/dashboard_embeddable_examples/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import {
EuiSideNav,
} from '@elastic/eui';
import 'brace/mode/json';
import { AppMountParameters } from '../../../src/core/public';
import { AppMountParameters, IUiSettingsClient } from '../../../src/core/public';
import { DashboardEmbeddableByValue } from './by_value/embeddable';
import { DashboardStart } from '../../../src/plugins/dashboard/public';
import { KibanaContextProvider } from '../../../src/plugins/kibana_react/public';

interface PageDef {
title: string;
Expand Down Expand Up @@ -58,9 +59,14 @@ interface Props {
DashboardContainerByValueRenderer: ReturnType<
DashboardStart['getDashboardContainerByValueRenderer']
>;
uiSettings: IUiSettingsClient;
}

const DashboardEmbeddableExplorerApp = ({ basename, DashboardContainerByValueRenderer }: Props) => {
const DashboardEmbeddableExplorerApp = ({
basename,
DashboardContainerByValueRenderer,
uiSettings,
}: Props) => {
const pages: PageDef[] = [
{
title: 'By value dashboard embeddable',
Expand All @@ -83,16 +89,18 @@ const DashboardEmbeddableExplorerApp = ({ basename, DashboardContainerByValueRen
));

return (
<Router basename={basename}>
<EuiPage>
<EuiPageSideBar>
<Nav pages={pages} />
</EuiPageSideBar>
<EuiPageContent>
<EuiPageContentBody>{routes}</EuiPageContentBody>
</EuiPageContent>
</EuiPage>
</Router>
<KibanaContextProvider services={{ uiSettings }}>
<Router basename={basename}>
<EuiPage>
<EuiPageSideBar>
<Nav pages={pages} />
</EuiPageSideBar>
<EuiPageContent>
<EuiPageContentBody>{routes}</EuiPageContentBody>
</EuiPageContent>
</EuiPage>
</Router>
</KibanaContextProvider>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import React from 'react';
import { EuiButton } from '@elastic/eui';
import { JsonEditor } from '../../../../src/plugins/es_ui_shared/public';
import { CodeEditor } from '../../../../src/plugins/kibana_react/public';

export const InputEditor = <T,>(props: { input: T; onSubmit: (value: T) => void }) => {
const input = JSON.stringify(props.input, null, 4);
Expand All @@ -26,12 +26,13 @@ export const InputEditor = <T,>(props: { input: T; onSubmit: (value: T) => void
}, [input]);
return (
<>
<JsonEditor
<CodeEditor
languageId={'json'}
value={value}
onUpdate={(v) => setValue(v.data.raw)}
euiCodeEditorProps={{
'data-test-subj': 'dashboardEmbeddableByValueInputEditor',
}}
width={'100%'}
height={'400px'}
onChange={(v) => setValue(v)}
data-test-subj={'dashboardEmbeddableByValueInputEditor'}
/>
<EuiButton
onClick={() => props.onSubmit(JSON.parse(value))}
Expand Down
3 changes: 2 additions & 1 deletion examples/dashboard_embeddable_examples/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ export class DashboardEmbeddableExamples implements Plugin<void, void, {}, Start
title: 'Dashboard embeddable examples',
navLinkStatus: AppNavLinkStatus.hidden,
async mount(params: AppMountParameters) {
const [, depsStart] = await core.getStartServices();
const [coreStart, depsStart] = await core.getStartServices();
const { renderApp } = await import('./app');
await depsStart.embeddableExamples.createSampleData();
return renderApp(
{
basename: params.appBasePath,
DashboardContainerByValueRenderer:
depsStart.dashboard.getDashboardContainerByValueRenderer(),
uiSettings: coreStart.uiSettings,
},
params.element
);
Expand Down
2 changes: 1 addition & 1 deletion examples/dashboard_embeddable_examples/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/dashboard/tsconfig.json" },
{ "path": "../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../src/plugins/es_ui_shared/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../embeddable_examples/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
"constate": "^1.3.2",
"content-disposition": "0.5.3",
"copy-to-clipboard": "^3.0.8",
"core-js": "^3.18.2",
"core-js": "^3.18.3",
"cronstrue": "^1.51.0",
"cytoscape": "^3.10.0",
"cytoscape-dagre": "^2.2.2",
Expand Down Expand Up @@ -420,19 +420,19 @@
},
"devDependencies": {
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.5",
"@babel/eslint-parser": "^7.15.7",
"@babel/core": "^7.15.8",
"@babel/eslint-parser": "^7.15.8",
"@babel/eslint-plugin": "^7.14.5",
"@babel/generator": "^7.15.4",
"@babel/parser": "^7.15.7",
"@babel/generator": "^7.15.8",
"@babel/parser": "^7.15.8",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
"@babel/plugin-proposal-object-rest-spread": "^7.15.6",
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
"@babel/plugin-proposal-private-methods": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"@babel/plugin-transform-runtime": "^7.15.8",
"@babel/preset-env": "^7.15.8",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.15.0",
"@babel/register": "^7.15.3",
Expand Down
1 change: 1 addition & 0 deletions packages/elastic-apm-generator/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export { getTransactionMetrics } from './lib/utils/get_transaction_metrics';
export { getSpanDestinationMetrics } from './lib/utils/get_span_destination_metrics';
export { getObserverDefaults } from './lib/defaults/get_observer_defaults';
export { toElasticsearchOutput } from './lib/output/to_elasticsearch_output';
export { getBreakdownMetrics } from './lib/utils/get_breakdown_metrics';
Loading

0 comments on commit 8e88366

Please sign in to comment.