diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.js b/.buildkite/scripts/steps/storybooks/build_and_upload.js
index c1032575ae4a6..49e36d2126cd4 100644
--- a/.buildkite/scripts/steps/storybooks/build_and_upload.js
+++ b/.buildkite/scripts/steps/storybooks/build_and_upload.js
@@ -6,13 +6,20 @@ const path = require('path');
const STORYBOOKS = [
'apm',
'canvas',
+ 'codeeditor',
'ci_composite',
'url_template_editor',
- 'codeeditor',
'dashboard',
'dashboard_enhanced',
'data_enhanced',
'embeddable',
+ 'expression_error',
+ 'expression_image',
+ 'expression_metric',
+ 'expression_repeat_image',
+ 'expression_reveal_image',
+ 'expression_shape',
+ 'expression_tagcloud',
'fleet',
'infra',
'security_solution',
diff --git a/.eslintrc.js b/.eslintrc.js
index 83afc27263248..c78a9f4aca2ac 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -930,6 +930,15 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/unified-signatures': 'error',
+ 'no-restricted-imports': [
+ 'error',
+ {
+ // prevents code from importing files that contain the name "legacy" within their name. This is a mechanism
+ // to help deprecation and prevent accidental re-use/continued use of code we plan on removing. If you are
+ // finding yourself turning this off a lot for "new code" consider renaming the file and functions if it is has valid uses.
+ patterns: ['*legacy*'],
+ },
+ ],
},
},
{
@@ -1192,6 +1201,15 @@ module.exports = {
'no-template-curly-in-string': 'error',
'sort-keys': 'error',
'prefer-destructuring': 'error',
+ 'no-restricted-imports': [
+ 'error',
+ {
+ // prevents code from importing files that contain the name "legacy" within their name. This is a mechanism
+ // to help deprecation and prevent accidental re-use/continued use of code we plan on removing. If you are
+ // finding yourself turning this off a lot for "new code" consider renaming the file and functions if it has valid uses.
+ patterns: ['*legacy*'],
+ },
+ ],
},
},
/**
@@ -1304,6 +1322,15 @@ module.exports = {
'no-template-curly-in-string': 'error',
'sort-keys': 'error',
'prefer-destructuring': 'error',
+ 'no-restricted-imports': [
+ 'error',
+ {
+ // prevents code from importing files that contain the name "legacy" within their name. This is a mechanism
+ // to help deprecation and prevent accidental re-use/continued use of code we plan on removing. If you are
+ // finding yourself turning this off a lot for "new code" consider renaming the file and functions if it has valid uses.
+ patterns: ['*legacy*'],
+ },
+ ],
},
},
/**
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 6ae834b58fc89..4c9df7e094ee6 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -56,6 +56,7 @@
/examples/url_generators_examples/ @elastic/kibana-app-services
/examples/url_generators_explorer/ @elastic/kibana-app-services
/examples/field_formats_example/ @elastic/kibana-app-services
+/examples/partial_results_example/ @elastic/kibana-app-services
/packages/elastic-datemath/ @elastic/kibana-app-services
/packages/kbn-interpreter/ @elastic/kibana-app-services
/src/plugins/bfetch/ @elastic/kibana-app-services
diff --git a/dev_docs/key_concepts/persistable_state.mdx b/dev_docs/key_concepts/persistable_state.mdx
new file mode 100644
index 0000000000000..4368417170eed
--- /dev/null
+++ b/dev_docs/key_concepts/persistable_state.mdx
@@ -0,0 +1,83 @@
+---
+id: kibDevDocsPersistableStateIntro
+slug: /kibana-dev-docs/persistable-state-intro
+title: Persistable State
+summary: Persitable state is a key concept to understand when building a Kibana plugin.
+date: 2021-02-02
+tags: ['kibana','dev', 'contributor', 'api docs']
+---
+
+ “Persistable state” is developer-defined state that supports being persisted by a plugin other than the one defining it. Persistable State needs to be serializable and the owner can/should provide utilities to migrate it, extract and inject any it may contain, as well as telemetry collection utilities.
+
+## Exposing state that can be persisted
+
+Any plugin that exposes state that another plugin might persist should implement 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 .
+
+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.
+
+## Exposing state that can be persisted but is not owned by plugin exposing it (registry)
+
+Any plugin that owns collection of items (registry) whose state/configuration can be persisted should implement `PersistableStateService`
+interface on their `setup` contract and each item in the collection should implement interface.
+
+Example: Embeddable plugin owns the registry of embeddable factories to which other plugins can register new embeddable factories. Dashboard plugin
+stores a bunch of embeddable panels input in its saved object and URL. Embeddable plugin setup contract implements `PersistableStateService`
+interface and each `EmbeddableFactory` needs to implement `PersistableStateDefinition` interface.
+
+Embeddable plugin exposes this interfaces:
+```
+// EmbeddableInput implements Serializable
+
+export interface EmbeddableRegistryDefinition extends PersistableStateDefinition {
+ id: string;
+ ...
+}
+
+export interface EmbeddableSetup extends PersistableStateService;
+```
+
+Note: if your plugin doesn't expose the state (it is the only one storing state), the plugin doesn't need to implement the `PersistableStateService` interface.
+If the state your plugin is storing can be provided by other plugins (your plugin owns a registry) items in that registry still need to implement `PersistableStateDefinition` interface.
+
+## Storing persistable state as part of saved object
+
+Any plugin that stores any persistable state as part of their saved object should make sure that its saved object migration
+and reference extraction and injection methods correctly use the matching `PersistableStateService` implementation for the state they are storing.
+
+Take a look at [example saved object](https://github.com/elastic/kibana/blob/master/examples/embeddable_examples/server/searchable_list_saved_object.ts#L32) which stores an embeddable state. Note how the `migrations`, `extractReferences` and `injectReferences` are defined.
+
+## Storing persistable state as part of URL
+
+When storing persistable state as part of URL you must make sure your URL is versioned. When loading the state `migrateToLatest` method
+of `PersistableStateService` should be called, which will migrate the state from its original version to latest.
+
+note: Currently there is no recommended way on how to store version in url and its up to every application to decide on how to implement that.
+
+## Available state operations
+
+### Extraction/Injection of References
+
+In order to support import and export, and space-sharing capabilities, Saved Objects need to explicitly list any references they contain to other Saved Objects.
+To support persisting your state in saved objects owned by another plugin, the and methods of Persistable State interface should be implemented.
+
+
+
+[See example embeddable providing extract/inject functions](https://github.com/elastic/kibana/blob/master/examples/embeddable_examples/public/migrations/migrations_embeddable_factory.ts)
+
+### Migrations and Backward compatibility
+
+As your plugin evolves, you may need to change your state in a breaking way. If that happens, you should write a migration to upgrade the state that existed prior to the change.
+
+.
+
+[See an example saved object storing embeddable state implementing saved object migration function](https://github.com/elastic/kibana/blob/master/examples/embeddable_examples/server/searchable_list_saved_object.ts)
+
+[See example embeddable providing migration functions](https://github.com/elastic/kibana/blob/master/examples/embeddable_examples/public/migrations/migrations_embeddable_factory.ts)
+
+## Telemetry
+
+You might want to collect statistics about how your state is used. If that is the case you should implement the telemetry method of Persistable State interface.
diff --git a/docs/apm/dependencies.asciidoc b/docs/apm/dependencies.asciidoc
new file mode 100644
index 0000000000000..b3afdc4880df5
--- /dev/null
+++ b/docs/apm/dependencies.asciidoc
@@ -0,0 +1,32 @@
+[role="xpack"]
+[[dependencies]]
+=== Dependencies
+
+APM agents collect details about external calls made from instrumented services.
+Sometimes, these external calls resolve into a downstream service that's instrumented -- in these cases,
+you can utilize <> to drill down into problematic downstream services.
+Other times, though, it's not possible to instrument a downstream dependency --
+like with a database or third-party service.
+**Dependencies** gives you a window into these uninstrumented, downstream dependencies.
+
+[role="screenshot"]
+image::apm/images/dependencies.png[Dependencies view in the APM app in Kibana]
+
+Many application issues are caused by slow or unresponsive downstream dependencies.
+And because a single, slow dependency can significantly impact the end-user experience,
+it's important to be able to quickly identify these problems and determine the root cause.
+
+Select a dependency to see detailed latency, throughput, and failed transaction rate metrics.
+
+[role="screenshot"]
+image::apm/images/dependencies-drilldown.png[Dependencies drilldown view in the APM app in Kibana]
+
+When viewing a dependency, consider your pattern of usage with that dependency.
+If your usage pattern _hasn't_ increased or decreased,
+but the experience has been negatively effected -- either with an increase in latency or errors,
+there's likely a problem with the dependency that needs to be addressed.
+
+If your usage pattern _has_ changed, the dependency view can quickly show you whether
+that pattern change exists in all upstream services, or just a subset of your services.
+You might then start digging into traces coming from
+impacted services to determine why that pattern change has occurred.
diff --git a/docs/apm/errors.asciidoc b/docs/apm/errors.asciidoc
index c468d7f0235b2..d8fc75bf50340 100644
--- a/docs/apm/errors.asciidoc
+++ b/docs/apm/errors.asciidoc
@@ -4,19 +4,21 @@
TIP: {apm-overview-ref-v}/errors.html[Errors] are groups of exceptions with a similar exception or log message.
-The *Errors* overview provides a high-level view of the error message and culprit,
-the number of occurrences, and the most recent occurrence.
-Just like the transaction overview, you'll notice we group together like errors.
-This makes it very easy to quickly see which errors are affecting your services,
+The *Errors* overview provides a high-level view of the exceptions that APM agents catch,
+or that users manually report with APM agent APIs.
+Like errors are grouped together to make it easy to quickly see which errors are affecting your services,
and to take actions to rectify them.
+A service returning a 5xx code from a request handler, controller, etc., will not create
+an exception that an APM agent can catch, and will therefore not show up in this view.
+
[role="screenshot"]
-image::apm/images/apm-errors-overview.png[Example view of the errors overview in the APM app in Kibana]
+image::apm/images/apm-errors-overview.png[APM Errors overview]
Selecting an error group ID or error message brings you to the *Error group*.
[role="screenshot"]
-image::apm/images/apm-error-group.png[Example view of the error group page in the APM app in Kibana]
+image::apm/images/apm-error-group.png[APM Error group]
Here, you'll see the error message, culprit, and the number of occurrences over time.
diff --git a/docs/apm/getting-started.asciidoc b/docs/apm/getting-started.asciidoc
index e448c0beb8b99..6b205d0274262 100644
--- a/docs/apm/getting-started.asciidoc
+++ b/docs/apm/getting-started.asciidoc
@@ -29,6 +29,7 @@ start with:
* <>
* <>
+* <>
* <>
Notice something awry? Select a service or trace and dive deeper with:
@@ -46,6 +47,8 @@ include::services.asciidoc[]
include::traces.asciidoc[]
+include::dependencies.asciidoc[]
+
include::service-maps.asciidoc[]
include::service-overview.asciidoc[]
diff --git a/docs/apm/images/all-instances.png b/docs/apm/images/all-instances.png
index e77c8af2c46f6..70028b5a9b58b 100644
Binary files a/docs/apm/images/all-instances.png and b/docs/apm/images/all-instances.png differ
diff --git a/docs/apm/images/apm-distributed-tracing.png b/docs/apm/images/apm-distributed-tracing.png
index 0dbffa591d43a..4d1b8cde20e95 100644
Binary files a/docs/apm/images/apm-distributed-tracing.png and b/docs/apm/images/apm-distributed-tracing.png differ
diff --git a/docs/apm/images/apm-geo-ui.png b/docs/apm/images/apm-geo-ui.png
index 5bbe713c908a4..69c1390a27989 100644
Binary files a/docs/apm/images/apm-geo-ui.png and b/docs/apm/images/apm-geo-ui.png differ
diff --git a/docs/apm/images/apm-logs-tab.png b/docs/apm/images/apm-logs-tab.png
index 891d2b7a1dd69..c79be8b5eb0b7 100644
Binary files a/docs/apm/images/apm-logs-tab.png and b/docs/apm/images/apm-logs-tab.png differ
diff --git a/docs/apm/images/apm-services-overview.png b/docs/apm/images/apm-services-overview.png
index 7aeb5f1ac379f..271c0347aa53e 100644
Binary files a/docs/apm/images/apm-services-overview.png and b/docs/apm/images/apm-services-overview.png differ
diff --git a/docs/apm/images/apm-span-detail.png b/docs/apm/images/apm-span-detail.png
index c9f55575b2232..d0b6a4de3d3df 100644
Binary files a/docs/apm/images/apm-span-detail.png and b/docs/apm/images/apm-span-detail.png differ
diff --git a/docs/apm/images/apm-transaction-duration-dist.png b/docs/apm/images/apm-transaction-duration-dist.png
index 91ae6c3a59ad2..9c7ab5dd67dc0 100644
Binary files a/docs/apm/images/apm-transaction-duration-dist.png and b/docs/apm/images/apm-transaction-duration-dist.png differ
diff --git a/docs/apm/images/apm-transaction-sample.png b/docs/apm/images/apm-transaction-sample.png
index 54eea902f0311..a9490fc20d853 100644
Binary files a/docs/apm/images/apm-transaction-sample.png and b/docs/apm/images/apm-transaction-sample.png differ
diff --git a/docs/apm/images/apm-transactions-overview.png b/docs/apm/images/apm-transactions-overview.png
index 66cf739a861b7..34cd0219b895d 100644
Binary files a/docs/apm/images/apm-transactions-overview.png and b/docs/apm/images/apm-transactions-overview.png differ
diff --git a/docs/apm/images/apm-transactions-table.png b/docs/apm/images/apm-transactions-table.png
index b573adfb0c450..8a3415bc9a9f1 100644
Binary files a/docs/apm/images/apm-transactions-table.png and b/docs/apm/images/apm-transactions-table.png differ
diff --git a/docs/apm/images/dependencies-drilldown.png b/docs/apm/images/dependencies-drilldown.png
new file mode 100644
index 0000000000000..4c491c1ffa254
Binary files /dev/null and b/docs/apm/images/dependencies-drilldown.png differ
diff --git a/docs/apm/images/dependencies.png b/docs/apm/images/dependencies.png
new file mode 100644
index 0000000000000..260025d31654b
Binary files /dev/null and b/docs/apm/images/dependencies.png differ
diff --git a/docs/apm/images/error-rate.png b/docs/apm/images/error-rate.png
index 036c7a08302bd..845fa2af07de1 100644
Binary files a/docs/apm/images/error-rate.png and b/docs/apm/images/error-rate.png differ
diff --git a/docs/apm/images/spans-dependencies.png b/docs/apm/images/spans-dependencies.png
index d6e26a5061a6e..558099dd450c1 100644
Binary files a/docs/apm/images/spans-dependencies.png and b/docs/apm/images/spans-dependencies.png differ
diff --git a/docs/apm/index.asciidoc b/docs/apm/index.asciidoc
index f4d35a2d554ba..385d9921ae2b0 100644
--- a/docs/apm/index.asciidoc
+++ b/docs/apm/index.asciidoc
@@ -4,8 +4,7 @@
[partintro]
--
-The APM app in {kib} is provided with the basic license.
-It allows you to monitor your software services and applications in real-time;
+The APM app in {kib} allows you to monitor your software services and applications in real-time;
visualize detailed performance information on your services,
identify and analyze errors,
and monitor host-level and agent-specific metrics like JVM and Go runtime metrics.
diff --git a/docs/apm/service-overview.asciidoc b/docs/apm/service-overview.asciidoc
index f1096a4e43bbc..05537cef58c98 100644
--- a/docs/apm/service-overview.asciidoc
+++ b/docs/apm/service-overview.asciidoc
@@ -69,34 +69,43 @@ image::apm/images/traffic-transactions.png[Traffic and transactions]
[discrete]
[[service-error-rates]]
-=== Error rate and errors
+=== Failed transaction rate and errors
-The *Error rate* chart displays the average error rates relating to the service, within a specific time range.
-An HTTP response code greater than 400 does not necessarily indicate a failed transaction.
-<>.
+The failed transaction rate represents the percentage of failed transactions from the perspective of the selected service.
+It's useful for visualizing unexpected increases, decreases, or irregular patterns in a service's transactions.
++
+[TIP]
+====
+HTTP **transactions** from the HTTP server perspective do not consider a `4xx` status code (client error) as a failure
+because the failure was caused by the caller, not the HTTP server. Thus, `event.outcome=success` and there will be no increase in failed transaction rate.
+
+HTTP **spans** from the client perspective however, are considered failures if the HTTP status code is ≥ 400.
+These spans will set `event.outcome=failure` and increase the failed transaction rate.
+
+If there is no HTTP status, both transactions and spans are considered successful unless an error is reported.
+====
The *Errors* table provides a high-level view of each error message when it first and last occurred,
along with the total number of occurrences. This makes it very easy to quickly see which errors affect
your services and take actions to rectify them. To do so, click *View errors*.
[role="screenshot"]
-image::apm/images/error-rate.png[Error rate and errors]
+image::apm/images/error-rate.png[failed transaction rate and errors]
[discrete]
[[service-span-duration]]
=== Span types average duration and dependencies
-The *Average duration by span type* chart visualizes each span type's average duration and helps you determine
+The *Time spent by span type* chart visualizes each span type's average duration and helps you determine
which spans could be slowing down transactions. The "app" label displayed under the
chart indicates that something was happening within the application. This could signal that the
agent does not have auto-instrumentation for whatever was happening during that time or that the time was spent in the
application code and not in database or external requests.
The *Dependencies* table displays a list of downstream services or external connections relevant
-to the service at the selected time range. The table displays latency, traffic, error rate, and the impact of
+to the service at the selected time range. The table displays latency, throughput, failed transaction rate, and the impact of
each dependency. By default, dependencies are sorted by _Impact_ to show the most used and the slowest dependency.
-If there is a particular dependency you are interested in, click *View service map* to view the related
-<>.
+If there is a particular dependency you are interested in, click *<>* to learn more about it.
NOTE: Displaying dependencies for services instrumented with the Real User Monitoring (RUM) agent
requires an agent version ≥ v5.6.3.
@@ -106,11 +115,11 @@ image::apm/images/spans-dependencies.png[Span type duration and dependencies]
[discrete]
[[service-instances]]
-=== All instances
+=== Instances
-The *All instances* table displays a list of all the available service instances within the selected time range.
-Depending on how the service runs, the instance could be a host or a container. The table displays latency, traffic,
-errors, CPU usage, and memory usage for each instance. By default, instances are sorted by _Throughput_.
+The *Instances* table displays a list of all the available service instances within the selected time range.
+Depending on how the service runs, the instance could be a host or a container. The table displays latency, throughput,
+failed transaction, CPU usage, and memory usage for each instance. By default, instances are sorted by _Throughput_.
[role="screenshot"]
image::apm/images/all-instances.png[All instances]
diff --git a/docs/apm/set-up.asciidoc b/docs/apm/set-up.asciidoc
index b2e78bd08bc93..3cbe45ec913b7 100644
--- a/docs/apm/set-up.asciidoc
+++ b/docs/apm/set-up.asciidoc
@@ -8,7 +8,7 @@
APM is available via the navigation sidebar in {Kib}.
If you have not already installed and configured Elastic APM,
-the *Setup Instructions* in Kibana will get you started.
+the *Add data* page will get you started.
[role="screenshot"]
image::apm/images/apm-setup.png[Installation instructions on the APM page in Kibana]
@@ -17,10 +17,9 @@ image::apm/images/apm-setup.png[Installation instructions on the APM page in Kib
[[apm-configure-index-pattern]]
=== Load the index pattern
-Index patterns tell Kibana which Elasticsearch indices you want to explore.
+Index patterns tell {kib} which {es} indices you want to explore.
An APM index pattern is necessary for certain features in the APM app, like the query bar.
-To set up the correct index pattern,
-simply click *Load Kibana objects* at the bottom of the Setup Instructions.
+To set up the correct index pattern, on the *Add data* page, click *Load Kibana objects*.
[role="screenshot"]
image::apm/images/apm-index-pattern.png[Setup index pattern for APM in Kibana]
diff --git a/docs/apm/transactions.asciidoc b/docs/apm/transactions.asciidoc
index 76006d375d075..c0850e4e9d507 100644
--- a/docs/apm/transactions.asciidoc
+++ b/docs/apm/transactions.asciidoc
@@ -8,7 +8,7 @@ APM agents automatically collect performance metrics on HTTP requests, database
[role="screenshot"]
image::apm/images/apm-transactions-overview.png[Example view of transactions table in the APM app in Kibana]
-The *Latency*, *transactions per minute*, *Error rate*, and *Average duration by span type*
+The *Latency*, *transactions per minute*, *Failed transaction rate*, and *Average duration by span type*
charts display information on all transactions associated with the selected service:
*Latency*::
@@ -23,17 +23,17 @@ Useful for determining if more responses than usual are being served with a part
Like in the latency graph, you can zoom in on anomalies to further investigate them.
[[transaction-error-rate]]
-*Error rate*::
-The error rate represents the percentage of failed transactions from the perspective of the selected service.
+*Failed transaction rate*::
+The failed transaction rate represents the percentage of failed transactions from the perspective of the selected service.
It's useful for visualizing unexpected increases, decreases, or irregular patterns in a service's transactions.
+
[TIP]
====
HTTP **transactions** from the HTTP server perspective do not consider a `4xx` status code (client error) as a failure
-because the failure was caused by the caller, not the HTTP server. Thus, there will be no increase in error rate.
+because the failure was caused by the caller, not the HTTP server. Thus, `event.outcome=success` and there will be no increase in failed transaction rate.
HTTP **spans** from the client perspective however, are considered failures if the HTTP status code is ≥ 400.
-These spans will increase the error rate.
+These spans will set `event.outcome=failure` and increase the failed transaction rate.
If there is no HTTP status, both transactions and spans are considered successful unless an error is reported.
====
@@ -97,7 +97,7 @@ This page is visually similar to the transaction overview, but it shows data fro
the selected transaction group.
[role="screenshot"]
-image::apm/images/apm-transaction-response-dist.png[Example view of response time distribution]
+image::apm/images/apm-transactions-overview.png[Example view of response time distribution]
[[transaction-duration-distribution]]
==== Latency distribution
@@ -110,10 +110,10 @@ It's the requests on the right, the ones taking longer than average, that we pro
[role="screenshot"]
image::apm/images/apm-transaction-duration-dist.png[Example view of latency distribution graph]
-Select a latency duration _bucket_ to display up to ten trace samples.
+Click and drag to select a latency duration _bucket_ to display up to 500 trace samples.
[[transaction-trace-sample]]
-==== Trace sample
+==== Trace samples
Trace samples are based on the _bucket_ selection in the *Latency distribution* chart;
update the samples by selecting a new _bucket_.
@@ -167,4 +167,11 @@ and solve problems.
[role="screenshot"]
image::apm/images/apm-logs-tab.png[APM logs tab]
-// To do: link to log correlation
+[[transaction-latency-correlations]]
+==== Correlations
+
+Correlations surface attributes of your data that are potentially correlated with high-latency or erroneous transactions.
+To learn more, see <>.
+
+[role="screenshot"]
+image::apm/images/correlations-hover.png[APM lattency correlations]
diff --git a/docs/dev-tools/console/console.asciidoc b/docs/dev-tools/console/console.asciidoc
index e1cd156e6a9e4..f29ddb1a600db 100644
--- a/docs/dev-tools/console/console.asciidoc
+++ b/docs/dev-tools/console/console.asciidoc
@@ -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,
diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc
index 1ab7ab60d4a8e..edc1821f3b223 100644
--- a/docs/developer/plugin-list.asciidoc
+++ b/docs/developer/plugin-list.asciidoc
@@ -44,6 +44,10 @@ as uiSettings within the code.
|Console provides the user with tools for storing and executing requests against Elasticsearch.
+|{kib-repo}blob/{branch}/src/plugins/custom_integrations/README.md[customIntegrations]
+|Register add-data cards
+
+
|<>
|- Registers the dashboard application.
- Adds a dashboard embeddable that can be used in other applications.
diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.displayname.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.displayname.md
new file mode 100644
index 0000000000000..71325318a68e6
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.displayname.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsTypeManagementDefinition](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.md) > [displayName](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.displayname.md)
+
+## SavedObjectsTypeManagementDefinition.displayName property
+
+When specified, will be used instead of the type's name in SO management section's labels.
+
+Signature:
+
+```typescript
+displayName?: string;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.md
index 2c3dd9f3f8434..057eb6284bf9e 100644
--- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.md
+++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstypemanagementdefinition.md
@@ -17,6 +17,7 @@ export interface SavedObjectsTypeManagementDefinition
| Property | Type | Description |
| --- | --- | --- |
| [defaultSearchField](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.defaultsearchfield.md) | string | The default search field to use for this type. Defaults to id. |
+| [displayName](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.displayname.md) | string | When specified, will be used instead of the type's name in SO management section's labels. |
| [getEditUrl](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.getediturl.md) | (savedObject: SavedObject<Attributes>) => string | Function returning the url to use to redirect to the editing page of this object. If not defined, editing will not be allowed. |
| [getInAppUrl](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.getinappurl.md) | (savedObject: SavedObject<Attributes>) => { path: string; uiCapabilitiesPath: string; } | Function returning the url to use to redirect to this object from the management section. If not defined, redirecting to the object will not be allowed. |
| [getTitle](./kibana-plugin-core-server.savedobjectstypemanagementdefinition.gettitle.md) | (savedObject: SavedObject<Attributes>) => string | Function returning the title to display in the management table. If not defined, will use the object's type and id to generate a label. |
diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc
index 872fcbbf83385..6fd83e8af3d15 100644
--- a/docs/management/advanced-options.asciidoc
+++ b/docs/management/advanced-options.asciidoc
@@ -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`.
diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc
index 050d14e4992d6..91e6b379a0620 100644
--- a/docs/settings/alert-action-settings.asciidoc
+++ b/docs/settings/alert-action-settings.asciidoc
@@ -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`.
diff --git a/docs/settings/apm-settings.asciidoc b/docs/settings/apm-settings.asciidoc
index 67de6f8d24960..d812576878f2b 100644
--- a/docs/settings/apm-settings.asciidoc
+++ b/docs/settings/apm-settings.asciidoc
@@ -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`.
diff --git a/docs/settings/dev-settings.asciidoc b/docs/settings/dev-settings.asciidoc
index b7edf36851d91..bcf4420cdadca 100644
--- a/docs/settings/dev-settings.asciidoc
+++ b/docs/settings/dev-settings.asciidoc
@@ -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 <>. Defaults to `true`.
@@ -21,6 +22,7 @@ Set to `true` to enable the <>. 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 <>. Defaults to `true`.
[float]
@@ -28,4 +30,5 @@ Set to `true` to enable the <>. Defaults to `tr
==== 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 <>. Defaults to `true`.
diff --git a/docs/settings/fleet-settings.asciidoc b/docs/settings/fleet-settings.asciidoc
index 3411f39309709..bf5c84324b0b9 100644
--- a/docs/settings/fleet-settings.asciidoc
+++ b/docs/settings/fleet-settings.asciidoc
@@ -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}.
|===
diff --git a/docs/settings/general-infra-logs-ui-settings.asciidoc b/docs/settings/general-infra-logs-ui-settings.asciidoc
index 2a9d4df1ff43c..282239dcf166c 100644
--- a/docs/settings/general-infra-logs-ui-settings.asciidoc
+++ b/docs/settings/general-infra-logs-ui-settings.asciidoc
@@ -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-*`.
diff --git a/docs/settings/graph-settings.asciidoc b/docs/settings/graph-settings.asciidoc
index 093edb0d08547..793a8aae73158 100644
--- a/docs/settings/graph-settings.asciidoc
+++ b/docs/settings/graph-settings.asciidoc
@@ -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}.
diff --git a/docs/settings/ml-settings.asciidoc b/docs/settings/ml-settings.asciidoc
index 92d0c0b491ce7..59fa236e08275 100644
--- a/docs/settings/ml-settings.asciidoc
+++ b/docs/settings/ml-settings.asciidoc
@@ -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,
diff --git a/docs/settings/monitoring-settings.asciidoc b/docs/settings/monitoring-settings.asciidoc
index 31148f0abf4e1..03c11007c64c4 100644
--- a/docs/settings/monitoring-settings.asciidoc
+++ b/docs/settings/monitoring-settings.asciidoc
@@ -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
<> setting, when this setting is `false`, the
monitoring back-end does not run and {kib} stats are not sent to the monitoring
cluster.
diff --git a/docs/settings/security-settings.asciidoc b/docs/settings/security-settings.asciidoc
index 455ee76deefe3..906af1dfbb28e 100644
--- a/docs/settings/security-settings.asciidoc
+++ b/docs/settings/security-settings.asciidoc
@@ -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. +
+
diff --git a/docs/settings/spaces-settings.asciidoc b/docs/settings/spaces-settings.asciidoc
index 3b643f76f0c09..8504464da1dfb 100644
--- a/docs/settings/spaces-settings.asciidoc
+++ b/docs/settings/spaces-settings.asciidoc
@@ -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
diff --git a/docs/settings/url-drilldown-settings.asciidoc b/docs/settings/url-drilldown-settings.asciidoc
index 8be3a21bfbffc..ca414d4f650e9 100644
--- a/docs/settings/url-drilldown-settings.asciidoc
+++ b/docs/settings/url-drilldown-settings.asciidoc
@@ -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.
diff --git a/docs/setup/docker.asciidoc b/docs/setup/docker.asciidoc
index cc14e79c54f15..01fc6e2e76f92 100644
--- a/docs/setup/docker.asciidoc
+++ b/docs/setup/docker.asciidoc
@@ -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 <> can be configured with this technique.
diff --git a/docs/setup/secure-settings.asciidoc b/docs/setup/secure-settings.asciidoc
index 840a18ac03bab..55b8c39e0ede8 100644
--- a/docs/setup/secure-settings.asciidoc
+++ b/docs/setup/secure-settings.asciidoc
@@ -18,8 +18,8 @@ To create the `kibana.keystore`, use the `create` command:
bin/kibana-keystore create
----------------------------------------------------------------
-The file `kibana.keystore` will be created in the directory defined by the
-<> configuration setting.
+The file `kibana.keystore` will be created in the `config` directory defined by the
+environment variable `KBN_PATH_CONF`.
[float]
[[list-settings]]
diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc
index 78b776c85c937..c098fb697de04 100644
--- a/docs/setup/settings.asciidoc
+++ b/docs/setup/settings.asciidoc
@@ -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`*
@@ -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.
diff --git a/docs/user/dashboard/images/tsvb_index_pattern_selection_mode.png b/docs/user/dashboard/images/tsvb_index_pattern_selection_mode.png
index ef72f291850e4..4a790650ae060 100644
Binary files a/docs/user/dashboard/images/tsvb_index_pattern_selection_mode.png and b/docs/user/dashboard/images/tsvb_index_pattern_selection_mode.png differ
diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc
index 0f130f15c8a77..c3e0a5523a78d 100644
--- a/docs/user/dashboard/lens.asciidoc
+++ b/docs/user/dashboard/lens.asciidoc
@@ -441,4 +441,20 @@ Pagination in a data table is unsupported. To use pagination in data tables, cre
[%collapsible]
====
Specifying the color for a single data point, such as a single bar or line, is unsupported.
-====
\ No newline at end of file
+====
+
+[discrete]
+[[is-it-possible-to-inspect-the-elasticsearch-queries-in-Lens]]
+.*How do I inspect {es} queries in visualizations?*
+[%collapsible]
+====
+You can inspect the requests sent by the visualization to {es} using the Inspector. It can be accessed within the editor or in the dashboard.
+====
+
+[discrete]
+[[how-to-isolate-a-single-series-in-a-chart]]
+.*How do I isolate a single series in a chart?*
+[%collapsible]
+====
+For area, line, and bar charts, press Shift, then click the series in the legend. All other series are automatically unselected.
+====
diff --git a/docs/user/dashboard/tsvb.asciidoc b/docs/user/dashboard/tsvb.asciidoc
index 5eb818b0ea3e4..80138990c4f6e 100644
--- a/docs/user/dashboard/tsvb.asciidoc
+++ b/docs/user/dashboard/tsvb.asciidoc
@@ -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 <> 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.
diff --git a/docs/user/dashboard/vega-reference.asciidoc b/docs/user/dashboard/vega-reference.asciidoc
index 0881afd1003da..1277797417c9e 100644
--- a/docs/user/dashboard/vega-reference.asciidoc
+++ b/docs/user/dashboard/vega-reference.asciidoc
@@ -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]
diff --git a/docs/user/plugins.asciidoc b/docs/user/plugins.asciidoc
index 0ef5d1a237510..c604526d6c933 100644
--- a/docs/user/plugins.asciidoc
+++ b/docs/user/plugins.asciidoc
@@ -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]
@@ -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]]
diff --git a/examples/embeddable_examples/kibana.json b/examples/embeddable_examples/kibana.json
index d725a5c94a9c8..103857804b5d4 100644
--- a/examples/embeddable_examples/kibana.json
+++ b/examples/embeddable_examples/kibana.json
@@ -9,7 +9,7 @@
"githubTeam": "kibana-app-services"
},
"description": "Example app that shows how to register custom embeddables",
- "requiredPlugins": ["embeddable", "uiActions", "savedObjects", "dashboard"],
+ "requiredPlugins": ["embeddable", "uiActions", "savedObjects", "dashboard", "kibanaUtils"],
"optionalPlugins": [],
"extraPublicDirs": ["public/todo", "public/hello_world", "public/todo/todo_ref_embeddable"],
"requiredBundles": ["kibanaReact"]
diff --git a/examples/embeddable_examples/public/migrations/migrations_embeddable_factory.ts b/examples/embeddable_examples/public/migrations/migrations_embeddable_factory.ts
index c1ceaaca3e466..61e6bfa56ec47 100644
--- a/examples/embeddable_examples/public/migrations/migrations_embeddable_factory.ts
+++ b/examples/embeddable_examples/public/migrations/migrations_embeddable_factory.ts
@@ -7,6 +7,7 @@
*/
import { i18n } from '@kbn/i18n';
+import { EmbeddableStateWithType } from '../../../../src/plugins/embeddable/common';
import {
IContainer,
EmbeddableInput,
@@ -35,6 +36,16 @@ export class SimpleEmbeddableFactoryDefinition
'7.3.0': migration730,
};
+ public extract(state: EmbeddableStateWithType) {
+ // this embeddable does not store references to other saved objects
+ return { state, references: [] };
+ }
+
+ public inject(state: EmbeddableStateWithType) {
+ // this embeddable does not store references to other saved objects
+ return state;
+ }
+
/**
* In our simple example, we let everyone have permissions to edit this. Most
* embeddables should check the UI Capabilities service to be sure of
diff --git a/examples/embeddable_examples/server/merge_migration_function_maps.ts b/examples/embeddable_examples/server/merge_migration_function_maps.ts
new file mode 100644
index 0000000000000..01a46949e6bbf
--- /dev/null
+++ b/examples/embeddable_examples/server/merge_migration_function_maps.ts
@@ -0,0 +1,25 @@
+/*
+ * 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 { mergeWith } from 'lodash';
+import type { SerializableRecord } from '@kbn/utility-types';
+import { MigrateFunctionsObject, MigrateFunction } from '../../../src/plugins/kibana_utils/common';
+
+export const mergeMigrationFunctionMaps = (
+ obj1: MigrateFunctionsObject,
+ obj2: MigrateFunctionsObject
+) => {
+ const customizer = (objValue: MigrateFunction, srcValue: MigrateFunction) => {
+ if (!srcValue || !objValue) {
+ return srcValue || objValue;
+ }
+ return (state: SerializableRecord) => objValue(srcValue(state));
+ };
+
+ return mergeWith({ ...obj1 }, obj2, customizer);
+};
diff --git a/examples/embeddable_examples/server/searchable_list_saved_object.ts b/examples/embeddable_examples/server/searchable_list_saved_object.ts
index ac4656c7c2b77..a3b12a05323f0 100644
--- a/examples/embeddable_examples/server/searchable_list_saved_object.ts
+++ b/examples/embeddable_examples/server/searchable_list_saved_object.ts
@@ -9,9 +9,12 @@
import { mapValues } from 'lodash';
import { SavedObjectsType, SavedObjectUnsanitizedDoc } from 'kibana/server';
import { EmbeddableSetup } from '../../../src/plugins/embeddable/server';
+// NOTE: this should rather be imported from 'plugins/kibana_utils/server' but examples at the moment don't
+// allow static imports from plugins so this code was duplicated
+import { mergeMigrationFunctionMaps } from './merge_migration_function_maps';
export const searchableListSavedObject = (embeddable: EmbeddableSetup) => {
- return {
+ const searchableListSO: SavedObjectsType = {
name: 'searchableList',
hidden: false,
namespaceType: 'single',
@@ -30,14 +33,22 @@ export const searchableListSavedObject = (embeddable: EmbeddableSetup) => {
},
},
migrations: () => {
- // we assume all the migration will be done by embeddables service and that saved object holds no extra state besides that of searchable list embeddable input\
- // if saved object would hold additional information we would need to merge the response from embeddables.getAllMigrations with our custom migrations.
- return mapValues(embeddable.getAllMigrations(), (migrate) => {
+ // there are no migrations defined for the saved object at the moment, possibly they would be added in the future
+ const searchableListSavedObjectMigrations = {};
+
+ // we don't know if embeddables have any migrations defined so we need to fetch them and map the received functions so we pass
+ // them the correct input and that we correctly map the response
+ const embeddableMigrations = mapValues(embeddable.getAllMigrations(), (migrate) => {
return (state: SavedObjectUnsanitizedDoc) => ({
...state,
attributes: migrate(state.attributes),
});
});
+
+ // we merge our and embeddable migrations and return
+ return mergeMigrationFunctionMaps(searchableListSavedObjectMigrations, embeddableMigrations);
},
- } as SavedObjectsType;
+ };
+
+ return searchableListSO;
};
diff --git a/examples/partial_results_example/README.md b/examples/partial_results_example/README.md
new file mode 100755
index 0000000000000..21496861ba464
--- /dev/null
+++ b/examples/partial_results_example/README.md
@@ -0,0 +1,9 @@
+## Partial Results Example
+
+The partial results is a feature of the expressions plugin allowing to emit intermediate execution results over time.
+
+This example plugin demonstrates:
+
+1. An expression function emitting a datatable with intermediate results (`getEvents`).
+2. An expression function emitting an infinite number of results (`countEvent`).
+3. A combination of those two functions using the `mapColumn` function that continuously updates the resulting table.
diff --git a/examples/partial_results_example/kibana.json b/examples/partial_results_example/kibana.json
new file mode 100644
index 0000000000000..1fe46e55d4039
--- /dev/null
+++ b/examples/partial_results_example/kibana.json
@@ -0,0 +1,12 @@
+{
+ "id": "paertialResultsExample",
+ "version": "0.1.0",
+ "kibanaVersion": "kibana",
+ "ui": true,
+ "owner": {
+ "name": "App Services",
+ "githubTeam": "kibana-app-services"
+ },
+ "description": "A plugin demonstrating partial results in the expressions plugin",
+ "requiredPlugins": ["developerExamples", "expressions"]
+}
diff --git a/examples/partial_results_example/public/app/app.tsx b/examples/partial_results_example/public/app/app.tsx
new file mode 100644
index 0000000000000..5420ab0f4ceed
--- /dev/null
+++ b/examples/partial_results_example/public/app/app.tsx
@@ -0,0 +1,90 @@
+/*
+ * 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 React, { useContext, useEffect, useState } from 'react';
+import { pluck } from 'rxjs/operators';
+import {
+ EuiBasicTable,
+ EuiCallOut,
+ EuiCodeBlock,
+ EuiPage,
+ EuiPageBody,
+ EuiPageContent,
+ EuiPageContentBody,
+ EuiPageHeader,
+ EuiPageHeaderSection,
+ EuiSpacer,
+ EuiText,
+ EuiTitle,
+} from '@elastic/eui';
+import type { Datatable } from 'src/plugins/expressions';
+import { ExpressionsContext } from './expressions_context';
+
+const expression = `getEvents
+ | mapColumn name="Count" expression={
+ countEvent {pluck "event"}
+ }
+`;
+
+export function App() {
+ const expressions = useContext(ExpressionsContext);
+ const [datatable, setDatatable] = useState();
+
+ useEffect(() => {
+ const subscription = expressions
+ ?.execute(expression, null)
+ .getData()
+ .pipe(pluck('result'))
+ .subscribe((value) => setDatatable(value as Datatable));
+
+ return () => subscription?.unsubscribe();
+ }, [expressions]);
+
+ return (
+
+
+
+
+
+
Partial Results Demo
+
+
+
+
+
+
+
+ This example listens for the window events and adds them to the table along with a
+ trigger counter.
+