Update doc slugs to improve analytic tracking, move to appropriate folders (#113630)

* Update the slugs to improve google analytics drilldown tracking

* more slug updates

* Fix some formatting issues in building blocks

* update paths

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Stacey Gammon 2021-10-04 13:36:45 -04:00 committed by GitHub
parent a4eab441c0
commit eddbc8db6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 219 additions and 218 deletions

View file

@ -1,5 +1,5 @@
# Contributing to Kibana # Contributing to Kibana
If you are an employee at Elastic, please check out our Developer Guide [here](https://docs.elastic.dev/kibana-dev-docs/welcome). If you are an employee at Elastic, please check out our Developer Guide [here](https://docs.elastic.dev/kibana-dev-docs/getting-started/welcome).
If you are an external developer, we have a legacy developer guide [here](https://www.elastic.co/guide/en/kibana/master/development.html), or you can view the raw docs from our new, internal Developer Guide [here](./dev_docs/getting_started/dev_welcome.mdx). Eventually, our internal Developer Guide will be opened for public consumption. If you are an external developer, we have a legacy developer guide [here](https://www.elastic.co/guide/en/kibana/master/development.html), or you can view the raw docs from our new, internal Developer Guide [here](./dev_docs/getting_started/dev_welcome.mdx). Eventually, our internal Developer Guide will be opened for public consumption.

View file

@ -1,6 +1,6 @@
--- ---
id: kibStyleGuide id: kibStyleGuide
slug: /kibana-dev-docs/styleguide slug: /kibana-dev-docs/contributing/styleguide
title: Style Guide title: Style Guide
summary: JavaScript/TypeScript styleguide. summary: JavaScript/TypeScript styleguide.
date: 2021-05-06 date: 2021-05-06

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevDocsApiWelcome id: kibDevDocsApiWelcome
slug: /kibana-dev-docs/api-welcome slug: /kibana-dev-docs/api-meta/welcome
title: Welcome title: Welcome
summary: How to use our automatically generated API documentation summary: How to use our automatically generated API documentation
date: 2021-02-25 date: 2021-02-25

View file

@ -1,6 +1,6 @@
--- ---
id: kibBestPractices id: kibBestPractices
slug: /kibana-dev-docs/best-practices slug: /kibana-dev-docs/contributing/best-practices
title: Best practices title: Best practices
summary: Best practices to follow when building a Kibana plugin. summary: Best practices to follow when building a Kibana plugin.
date: 2021-03-17 date: 2021-03-17

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevPrinciples id: kibDevPrinciples
slug: /kibana-dev-docs/dev-principles slug: /kibana-dev-docs/contributing/dev-principles
title: Developer principles title: Developer principles
summary: Follow our development principles to help keep our code base stable, maintainable and scalable. summary: Follow our development principles to help keep our code base stable, maintainable and scalable.
date: 2021-03-04 date: 2021-03-04

View file

@ -1,6 +1,6 @@
--- ---
id: kibGitHub id: kibGitHub
slug: /kibana-dev-docs/github slug: /kibana-dev-docs/contributing/github
title: How we use Github title: How we use Github
summary: Forking, branching, committing and using labels in the Kibana GitHub repo summary: Forking, branching, committing and using labels in the Kibana GitHub repo
date: 2021-09-16 date: 2021-09-16

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevAddData id: kibDevAddData
slug: /kibana-dev-docs/tutorial/sample-data slug: /kibana-dev-docs/getting-started/sample-data
title: Add data title: Add data
summary: Learn how to add data to Kibana summary: Learn how to add data to Kibana
date: 2021-08-11 date: 2021-08-11

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevDocsWelcome id: kibDevDocsWelcome
slug: /kibana-dev-docs/welcome slug: /kibana-dev-docs/getting-started/welcome
title: Welcome title: Welcome
summary: Build custom solutions and applications on top of Kibana. summary: Build custom solutions and applications on top of Kibana.
date: 2021-01-02 date: 2021-01-02

View file

@ -1,6 +1,6 @@
--- ---
id: kibHelloWorldApp id: kibHelloWorldApp
slug: /kibana-dev-docs/hello-world-app slug: /kibana-dev-docs/getting-started/hello-world-app
title: Hello World title: Hello World
summary: Build a very basic plugin that registers an application that says "Hello World!". summary: Build a very basic plugin that registers an application that says "Hello World!".
date: 2021-08-03 date: 2021-08-03

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevTutorialSetupDevEnv id: kibDevTutorialSetupDevEnv
slug: /kibana-dev-docs/tutorial/setup-dev-env slug: /kibana-dev-docs/getting-started/setup-dev-env
title: Set up a Development Environment title: Set up a Development Environment
summary: Learn how to setup a development environment for contributing to the Kibana repository summary: Learn how to setup a development environment for contributing to the Kibana repository
date: 2021-04-26 date: 2021-04-26

View file

@ -1,6 +1,6 @@
--- ---
id: kibTroubleshooting id: kibTroubleshooting
slug: /kibana-dev-docs/troubleshooting slug: /kibana-dev-docs/getting-started/troubleshooting
title: Troubleshooting title: Troubleshooting
summary: A collection of tips for working around strange issues. summary: A collection of tips for working around strange issues.
date: 2021-09-08 date: 2021-09-08

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevAnatomyOfAPlugin id: kibDevAnatomyOfAPlugin
slug: /kibana-dev-docs/anatomy-of-a-plugin slug: /kibana-dev-docs/key-concepts/anatomy-of-a-plugin
title: Anatomy of a plugin title: Anatomy of a plugin
summary: Anatomy of a Kibana plugin. summary: Anatomy of a Kibana plugin.
date: 2021-08-03 date: 2021-08-03

View file

@ -1,6 +1,6 @@
--- ---
id: kibBuildingBlocks id: kibBuildingBlocks
slug: /kibana-dev-docs/building-blocks slug: /kibana-dev-docs/key-concepts/building-blocks
title: Building blocks title: Building blocks
summary: Consider these building blocks when developing your plugin. summary: Consider these building blocks when developing your plugin.
date: 2021-02-24 date: 2021-02-24
@ -17,10 +17,12 @@ with many built-in capabilities, require less maintenance, and evolve new featur
provide greater flexibility, but require more code to stitch them together into a meaningful UX. This results in higher maintenance cost for consumers and greater UI/UX variability provide greater flexibility, but require more code to stitch them together into a meaningful UX. This results in higher maintenance cost for consumers and greater UI/UX variability
across Kibana. across Kibana.
For example, if an application is using <DocLink id="kibBuildingBlocks" section="index-patterns" text="Index Patterns"/> and For example, if an application is using <DocLink id="kibBuildingBlocks" section="index-patterns" text="Index Patterns"/> and <DocLink id="kibBuildingBlocks" section="search-source" text="Search Source" />, their application would
<DocLink id="kibBuildingBlocks" section="search-source" text="Search Source"/>, automatically support runtime fields. If the app is instead using the lower-level <DocLink
their application would automatically support runtime fields. If the app is instead using the id="kibBuildingBlocks"
lower-level <DocLink id="kibBuildingBlocks" section="search-strategy" text="Search Strategy"/>, additional work would be required. section="search-strategy"
text="Search Strategy"
/>, additional work would be required.
Armed with this knowledge, you can choose what works best for your use case! Armed with this knowledge, you can choose what works best for your use case!
@ -33,22 +35,14 @@ The following high-level building blocks can be rendered directly into your appl
### Query Bar ### Query Bar
The <DocLink id="kibDataPlugin" text="Data plugin"/> provides a high-level Query Bar component that comes with support for Lucene, KQL, Saved Queries, The <DocLink id="kibDataPlugin" text="Data plugin"/> provides a high-level Query Bar component that comes with support for Lucene, KQL, Saved Queries,
and <DocLink id="kibBuildingBlocks" section="index-patterns" text="Index Patterns"/>. and <DocLink id="kibBuildingBlocks" section="index-patterns" text="Index Patterns"/>. If you would like to expose the ability to search and filter on Elasticsearch data, the Query Bar provided by the <DocLink id="kibDataPlugin" text="Data plugin" /> is your go-to building block.
If you would like to expose the ability to search and filter on Elasticsearch data, the Query Bar provided by the
<DocLink id="kibDataPlugin" text="Data plugin"/>
is your go-to building block.
**Github labels**: `Team:AppServices`, `Feature:QueryBar` **Github labels**: `Team:AppServices`, `Feature:QueryBar`
### Dashboard Embeddable ### Dashboard Embeddable
Add a Dashboard Embeddable directly inside your application to provide users with a set of visualizations and graphs that work seamlessly Add a Dashboard Embeddable directly inside your application to provide users with a set of visualizations and graphs that work seamlessly
with the <DocLink id="kibBuildingBlocks" section="query-bar" text="Query Bar"/>. Every feature that is added to a registered with the <DocLink id="kibBuildingBlocks" section="query-bar" text="Query Bar"/>. Every feature that is added to a registered <DocLink id="kibBuildingBlocks" section="embeddables" text="Embeddable" /> (Lens, Maps, Saved Searches and more) will be available automatically, as well as any <DocLink id="kibBuildingBlocks" section="ui-actions--triggers" text="UI Actions" /> that are added to the Embeddable context menu panel (for example, drilldowns, custom panel time ranges, and "share to" features).
<DocLink id="kibBuildingBlocks" section="embeddables" text="Embeddable"/>
(Lens, Maps, Saved Searches and more) will be available automatically, as well as any
<DocLink id="kibBuildingBlocks" section="ui-actions--triggers" text="UI Actions"/> that are
added to the Embeddable context menu panel (for example, drilldowns, custom panel time ranges, and "share to" features).
The Dashboard Embeddable is one of the highest-level UI components you can add to your application. The Dashboard Embeddable is one of the highest-level UI components you can add to your application.
@ -56,11 +50,7 @@ The Dashboard Embeddable is one of the highest-level UI components you can add t
### Lens Embeddable ### Lens Embeddable
Check out the Lens Embeddable if you wish to show users visualizations based on Elasticsearch data without worrying about query building and chart rendering. It's built on top of the Check out the Lens Embeddable if you wish to show users visualizations based on Elasticsearch data without worrying about query building and chart rendering. It's built on top of the <DocLink id="kibBuildingBlocks" section="expressions" text="Expression language" />, and integrates with <DocLink id="kibBuildingBlocks" section="index-patterns" text="Index Patterns" /> and <DocLink id="kibBuildingBlocks" section="ui-actions--triggers" text="UI Actions" />. Using the same configuration, it's also possible to link to a prefilled Lens editor, allowing the user to drill deeper and explore their data.
<DocLink id="kibBuildingBlocks" section="expressions" text="Expression language"/>, and integrates with
<DocLink id="kibBuildingBlocks" section="index-patterns" text="Index Patterns"/>
and <DocLink id="kibBuildingBlocks" section="ui-actions--triggers" text="UI Actions"/>. Using the same configuration, it's also possible to link to
a prefilled Lens editor, allowing the user to drill deeper and explore their data.
**Github labels**: `Team:VisEditors`, `Feature:Lens` **Github labels**: `Team:VisEditors`, `Feature:Lens`
@ -82,10 +72,11 @@ Check out <DocLink id="kibDevDocsKPTTutorial" text="the KibanaPageTemplate tutor
### Index Patterns ### Index Patterns
<DocLink id="kibDataPlugin" section="index-patterns-api" text="Index Patterns"/> are a high-level, space-aware abstraction layer that sits <DocLink id="kibDataPlugin" section="index-patterns-api" text="Index Patterns" /> are a high-level, space-aware
above Data Streams and Elasticsearch indices. Index Patterns provide users the abstraction layer that sits above Data Streams and Elasticsearch indices. Index Patterns provide users
ability to define and customize the data they wish to search and filter on, on a per-space basis. For example, users can specify a set of indices, the ability to define and customize the data they wish to search and filter on, on a per-space basis.
and they can customize the field list with runtime fields, formatting options and custom labels. For example, users can specify a set of indices, and they can customize the field list with runtime fields,
formatting options and custom labels.
Index Patterns are used in many other high-level building blocks so we highly recommend you consider this building block for your search needs. Index Patterns are used in many other high-level building blocks so we highly recommend you consider this building block for your search needs.
@ -93,11 +84,16 @@ Index Patterns are used in many other high-level building blocks so we highly re
### Search Source ### Search Source
<DocLink id="kibDataPlugin" section="searchsource" text="Search Source"/> is a high-level search service offered by the <DocLink id="kibDataPlugin" section="searchsource" text="Search Source" /> is a high-level search service
<DocLink id="kibDataPlugin" section="searchsource" text="Data plugin"/>. It requires an offered by the <DocLink id="kibDataPlugin" section="searchsource" text="Data plugin" />. It requires
<DocLink id="kibBuildingBlocks" section="index-patterns" text="Index Pattern"/>, and abstracts away the raw ES DSL and search endpoint. Internally an <DocLink id="kibBuildingBlocks" section="index-patterns" text="Index Pattern" />, and abstracts away
it uses the ES <DocLink id="kibBuildingBlocks" section="search-strategies" text="Search Strategy"/>. Use Search Source if you need to query data the raw ES DSL and search endpoint. Internally it uses the ES <DocLink
from Elasticsearch, and you aren't already using one of the high-level UI Components that handles this internally. id="kibBuildingBlocks"
section="search-strategies"
text="Search Strategy"
/>
. Use Search Source if you need to query data from Elasticsearch, and you aren't already using one of
the high-level UI Components that handles this internally.
**Github labels**: `Team:AppServices`, `Feature:Search` **Github labels**: `Team:AppServices`, `Feature:Search`
@ -112,17 +108,17 @@ languages, like EQL and SQL. These are very low-level building blocks so expect
### Expressions ### Expressions
Expressions are a low-level building block that can be used if you have advanced search needs that requiring piping results into additional functionality, like Expressions are a low-level building block that can be used if you have advanced search needs that requiring piping results into additional functionality, like
joining and manipulating data. Lens and Canvas are built on top of Expressions. Most developers should be able to use joining and manipulating data. Lens and Canvas are built on top of Expressions. Most developers should be able to use <DocLink id="kibBuildingBlocks" section="lens-embeddable" text="Lens" /> or <DocLink id="kibBuildingBlocks" section="search-source" text="Search Source" />, rather than need to
<DocLink id="kibBuildingBlocks" section="lens-embeddable" text="Lens"/> or access the Expression language directly.{' '}
<DocLink id="kibBuildingBlocks" section="search-source" text="Search Source"/>, rather than need to access the Expression language directly.
**Github labels**: `Team:AppServices`, `Feature:ExpressionLanguage` **Github labels**: `Team:AppServices`, `Feature:ExpressionLanguage`
## Saved Objects ## Saved Objects
<DocLink id="kibDevDocsSavedObjectsIntro" text="Saved Objects" /> should be used if you need to persist application-level information. If you were building a TODO <DocLink id="kibDevDocsSavedObjectsIntro" text="Saved Objects" /> should be used if you need to persist
application, each TODO item would be a `Saved Object`. Saved objects come pre-wired with support for bulk export/import, security features like space sharing and application-level information. If you were building a TODO application, each TODO item would be a `Saved
space isolation, and tags. Object`. Saved objects come pre-wired with support for bulk export/import, security features like space
sharing and space isolation, and tags.
**Github labels**: `Team:Core`, `Feature:Saved Objects` **Github labels**: `Team:Core`, `Feature:Saved Objects`

View file

@ -1,13 +1,13 @@
--- ---
id: kibDataViewsKeyConcepts id: kibDataViewsKeyConcepts
slug: /kibana-dev-docs/data-view-intro slug: /kibana-dev-docs/key-concepts/data-view-intro
title: Data Views title: Data Views
summary: Data views are the central method of defining queryable data sets in Kibana summary: Data views are the central method of defining queryable data sets in Kibana
date: 2021-08-11 date: 2021-08-11
tags: ['kibana', 'dev', 'contributor', 'api docs'] tags: ['kibana', 'dev', 'contributor', 'api docs']
--- ---
*Note: Kibana index patterns are currently being renamed to data views. There will be some naming inconsistencies until the transition is complete.* _Note: Kibana index patterns are currently being renamed to data views. There will be some naming inconsistencies until the transition is complete._
Data views (formerly Kibana index patterns or KIPs) are the central method of describing sets of indices for queries. Usage is strongly recommended Data views (formerly Kibana index patterns or KIPs) are the central method of describing sets of indices for queries. Usage is strongly recommended
as a number of high level <DocLink id="kibBuildingBlocks" text="building blocks"/> rely on them. Further, they provide a consistent view of data across as a number of high level <DocLink id="kibBuildingBlocks" text="building blocks"/> rely on them. Further, they provide a consistent view of data across
@ -20,8 +20,6 @@ on the data view via runtime fields. Schema-on-read functionality is provided by
![image](../assets/data_view_diagram.png) ![image](../assets/data_view_diagram.png)
The data view API is made available via the data plugin (`data.indexPatterns`, soon to be renamed) and most commonly used with <DocLink id="kibDevTutorialDataSearchAndSessions" section="high-level-search" text="SearchSource" /> The data view API is made available via the data plugin (`data.indexPatterns`, soon to be renamed) and most commonly used with <DocLink id="kibDevTutorialDataSearchAndSessions" section="high-level-search" text="SearchSource" />
(`data.search.search.SearchSource`) to perform queries. SearchSource will apply existing filters and queries from the search bar UI. (`data.search.search.SearchSource`) to perform queries. SearchSource will apply existing filters and queries from the search bar UI.
@ -29,4 +27,3 @@ Users can create data views via [Data view management](https://www.elastic.co/gu
Additionally, they can be created through the data view API. Additionally, they can be created through the data view API.
Data views also allow formatters and custom labels to be defined for fields. Data views also allow formatters and custom labels to be defined for fields.

View file

@ -1,6 +1,6 @@
--- ---
id: kibPlatformIntro id: kibPlatformIntro
slug: /kibana-dev-docs/platform-intro slug: /kibana-dev-docs/key-concepts/platform-intro
title: Plugins and the Kibana platform title: Plugins and the Kibana platform
summary: An introduction to the Kibana platform and how to use it to build a plugin. summary: An introduction to the Kibana platform and how to use it to build a plugin.
date: 2021-01-06 date: 2021-01-06

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevPerformance id: kibDevPerformance
slug: /kibana-dev-docs/performance slug: /kibana-dev-docs/key-concepts/performance
title: Performance title: Performance
summary: Performance tips for Kibana development. summary: Performance tips for Kibana development.
date: 2021-09-02 date: 2021-09-02
@ -9,13 +9,13 @@ tags: ['kibana', 'onboarding', 'dev', 'performance']
## Keep Kibana fast ## Keep Kibana fast
*tl;dr*: Load as much code lazily as possible. Everyone loves snappy _tl;dr_: Load as much code lazily as possible. Everyone loves snappy
applications with a responsive UI and hates spinners. Users deserve the applications with a responsive UI and hates spinners. Users deserve the
best experience whether they run Kibana locally or best experience whether they run Kibana locally or
in the cloud, regardless of their hardware and environment. in the cloud, regardless of their hardware and environment.
There are 2 main aspects of the perceived speed of an application: loading time There are 2 main aspects of the perceived speed of an application: loading time
and responsiveness to user actions. Kibana loads and bootstraps *all* and responsiveness to user actions. Kibana loads and bootstraps _all_
the plugins whenever a user lands on any page. It means that the plugins whenever a user lands on any page. It means that
every new application affects the overall _loading performance_, as plugin code is every new application affects the overall _loading performance_, as plugin code is
loaded _eagerly_ to initialize the plugin and provide plugin API to dependent loaded _eagerly_ to initialize the plugin and provide plugin API to dependent
@ -101,7 +101,7 @@ node scripts/build_kibana_platform_plugins.js --dist --no-examples --profile
Many OSS tools allow you to analyze the generated stats file: Many OSS tools allow you to analyze the generated stats file:
* [An official tool](https://webpack.github.io/analyse/#modules) from - [An official tool](https://webpack.github.io/analyse/#modules) from
Webpack authors Webpack authors
* [webpack-visualizer](https://chrisbateman.github.io/webpack-visualizer/) - [webpack-visualizer](https://chrisbateman.github.io/webpack-visualizer/)
* [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) - [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer)

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevDocsPersistableStateIntro id: kibDevDocsPersistableStateIntro
slug: /kibana-dev-docs/persistable-state-intro slug: /kibana-dev-docs/key-concepts/persistable-state-intro
title: Persistable State title: Persistable State
summary: Persitable state is a key concept to understand when building a Kibana plugin. summary: Persitable state is a key concept to understand when building a Kibana plugin.
date: 2021-02-02 date: 2021-02-02
@ -29,6 +29,7 @@ stores a bunch of embeddable panels input in its saved object and URL. Embeddabl
interface and each `EmbeddableFactory` needs to implement `PersistableStateDefinition` interface. interface and each `EmbeddableFactory` needs to implement `PersistableStateDefinition` interface.
Embeddable plugin exposes this interfaces: Embeddable plugin exposes this interfaces:
``` ```
// EmbeddableInput implements Serializable // EmbeddableInput implements Serializable
@ -64,7 +65,11 @@ note: Currently there is no recommended way on how to store version in url and i
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. 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 <DocLink id="kibKibanaUtilsPluginApi" section="def-common.PersistableState.extract" text="`extract`"/> and <DocLink id="kibKibanaUtilsPluginApi" section="def-common.PersistableState.inject" text="`inject`"/> methods of Persistable State interface should be implemented. To support persisting your state in saved objects owned by another plugin, the <DocLink id="kibKibanaUtilsPluginApi" section="def-common.PersistableState.extract" text="`extract`"/> and <DocLink id="kibKibanaUtilsPluginApi" section="def-common.PersistableState.inject" text="`inject`"/> methods of Persistable State interface should be implemented.
<DocLink id="kibDevTutorialSavedObject" section="references" text="Learn how to define Saved Object references"/> <DocLink
id="kibDevTutorialSavedObject"
section="references"
text="Learn how to define Saved Object references"
/>
[See example embeddable providing extract/inject functions](https://github.com/elastic/kibana/blob/master/examples/embeddable_examples/public/migrations/migrations_embeddable_factory.ts) [See example embeddable providing extract/inject functions](https://github.com/elastic/kibana/blob/master/examples/embeddable_examples/public/migrations/migrations_embeddable_factory.ts)

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevDocsSavedObjectsIntro id: kibDevDocsSavedObjectsIntro
slug: /kibana-dev-docs/saved-objects-intro slug: /kibana-dev-docs/key-concepts/saved-objects-intro
title: Saved Objects title: Saved Objects
summary: Saved Objects are a key concept to understand when building a Kibana plugin. summary: Saved Objects are a key concept to understand when building a Kibana plugin.
date: 2021-02-02 date: 2021-02-02
@ -17,7 +17,6 @@ services.
![image](../assets/saved_object_vs_data_indices.png) ![image](../assets/saved_object_vs_data_indices.png)
<DocLink id="kibDevTutorialSavedObject" text="Tutorial: Register a new Saved Object type" /> <DocLink id="kibDevTutorialSavedObject" text="Tutorial: Register a new Saved Object type" />
## References ## References
@ -26,7 +25,11 @@ In order to support import and export, and space-sharing capabilities, Saved Obj
The parent should have a reference to it's children, not the other way around. That way when a "parent" is exported (or shared to a space), The parent should have a reference to it's children, not the other way around. That way when a "parent" is exported (or shared to a space),
all the "children" will be automatically included. However, when a "child" is exported, it will not include all "parents". all the "children" will be automatically included. However, when a "child" is exported, it will not include all "parents".
<DocLink id="kibDevTutorialSavedObject" section="references" text="Learn how to define Saved Object references"/> <DocLink
id="kibDevTutorialSavedObject"
section="references"
text="Learn how to define Saved Object references"
/>
## Migrations and Backward compatibility ## Migrations and Backward compatibility
@ -80,7 +83,7 @@ on how it is registered.
If you are adding a **new** object type, when you register it: If you are adding a **new** object type, when you register it:
1. Use `namespaceType: 'multiple-isolated'` to make these objects exist in exactly one space 1. Use `namespaceType: 'multiple-isolated'` to make these objects exist in exactly one space
2. Use `namespaceType: 'multiple'` to make these objects exist in one *or more* spaces 2. Use `namespaceType: 'multiple'` to make these objects exist in one _or more_ spaces
3. Use `namespaceType: 'agnostic'` if you want these objects to always exist in all spaces 3. Use `namespaceType: 'agnostic'` if you want these objects to always exist in all spaces
If you have an **existing** "legacy" object type that is not shareable (using `namespaceType: 'single'`), see the [legacy developer guide If you have an **existing** "legacy" object type that is not shareable (using `namespaceType: 'single'`), see the [legacy developer guide

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevTutorialBuildingDistributable id: kibDevTutorialBuildingDistributable
slug: /kibana-dev-docs/tutorial/building-distributable slug: /kibana-dev-docs/tutorials/building-distributable
title: Building a Kibana distributable title: Building a Kibana distributable
summary: Learn how to build a Kibana distributable summary: Learn how to build a Kibana distributable
date: 2021-05-10 date: 2021-05-10

View file

@ -82,7 +82,7 @@ data.search.search(req).subscribe({
error: (e) => { error: (e) => {
data.search.showError(e); data.search.showError(e);
}, },
}) });
``` ```
If you decide to handle errors by yourself, watch for errors coming from `Elasticsearch`. They have an additional `attributes` property that holds the raw error from `Elasticsearch`. If you decide to handle errors by yourself, watch for errors coming from `Elasticsearch`. They have an additional `attributes` property that holds the raw error from `Elasticsearch`.
@ -95,7 +95,7 @@ data.search.search(req).subscribe({
showErrorReason(e.attributes); showErrorReason(e.attributes);
} }
}, },
}) });
``` ```
#### Stop a running search #### Stop a running search
@ -106,9 +106,11 @@ The search service `search` method supports a second argument called `options`.
import { AbortError } from '../../src/data/public'; import { AbortError } from '../../src/data/public';
const abortController = new AbortController(); const abortController = new AbortController();
data.search.search(req, { data.search
.search(req, {
abortSignal: abortController.signal, abortSignal: abortController.signal,
}).subscribe({ })
.subscribe({
next: (result) => { next: (result) => {
// handle result // handle result
}, },
@ -135,9 +137,11 @@ For example, to run an EQL query using the `data.search` service, you should to
```ts ```ts
const req = getEqlRequest(); const req = getEqlRequest();
data.search.search(req, { data.search
.search(req, {
strategy: EQL_SEARCH_STRATEGY, strategy: EQL_SEARCH_STRATEGY,
}).subscribe({ })
.subscribe({
next: (result) => { next: (result) => {
// handle EQL result // handle EQL result
}, },
@ -161,11 +165,11 @@ export const mySearchStrategyProvider = (
): ISearchStrategy<IMyStrategyRequest, IMyStrategyResponse> => { ): ISearchStrategy<IMyStrategyRequest, IMyStrategyResponse> => {
const preprocessRequest = (request: IMyStrategyRequest) => { const preprocessRequest = (request: IMyStrategyRequest) => {
// Custom preprocessing // Custom preprocessing
} };
const formatResponse = (response: IMyStrategyResponse) => { const formatResponse = (response: IMyStrategyResponse) => {
// Custom post-processing // Custom post-processing
} };
// Get the default search strategy // Get the default search strategy
const es = data.search.getSearchStrategy(ES_SEARCH_STRATEGY); const es = data.search.getSearchStrategy(ES_SEARCH_STRATEGY);
@ -179,11 +183,7 @@ export const mySearchStrategyProvider = (
```ts ```ts
// ./myPlugin/server/plugin.ts // ./myPlugin/server/plugin.ts
import type { import type { CoreSetup, CoreStart, Plugin } from 'kibana/server';
CoreSetup,
CoreStart,
Plugin,
} from 'kibana/server';
import { mySearchStrategyProvider } from './my_strategy'; import { mySearchStrategyProvider } from './my_strategy';
@ -202,10 +202,7 @@ export interface MyPluginStartDeps {
* In your custom server side plugin, register the strategy from the setup contract * In your custom server side plugin, register the strategy from the setup contract
*/ */
export class MyPlugin implements Plugin { export class MyPlugin implements Plugin {
public setup( public setup(core: CoreSetup<MyPluginStartDeps>, deps: MyPluginSetupDeps) {
core: CoreSetup<MyPluginStartDeps>,
deps: MyPluginSetupDeps
) {
core.getStartServices().then(([_, depsStart]) => { core.getStartServices().then(([_, depsStart]) => {
const myStrategy = mySearchStrategyProvider(depsStart.data); const myStrategy = mySearchStrategyProvider(depsStart.data);
deps.data.search.registerSearchStrategy('myCustomStrategy', myStrategy); deps.data.search.registerSearchStrategy('myCustomStrategy', myStrategy);
@ -217,9 +214,11 @@ export class MyPlugin implements Plugin {
```ts ```ts
// ./myPlugin/public/plugin.ts // ./myPlugin/public/plugin.ts
const req = getRequest(); const req = getRequest();
data.search.search(req, { data.search
.search(req, {
strategy: 'myCustomStrategy', strategy: 'myCustomStrategy',
}).subscribe({ })
.subscribe({
next: (result) => { next: (result) => {
// handle result // handle result
}, },
@ -310,7 +309,7 @@ data.search.search(req).subscribe({
renderPartialResult(res); renderPartialResult(res);
} }
}, },
}) });
// Skipping partial results // Skipping partial results
const finalResult = await data.search.search(req).toPromise(); const finalResult = await data.search.search(req).toPromise();
@ -324,12 +323,12 @@ Search sessions are handy when you want to enable a user to run something asynch
Internally, any search run within a search session is saved into an object, allowing Kibana to manage their lifecycle. Most saved objects are deleted automatically after a short period of time, but if a user chooses to save the search session, the saved object is persisted, so that results can be restored in a later time. Internally, any search run within a search session is saved into an object, allowing Kibana to manage their lifecycle. Most saved objects are deleted automatically after a short period of time, but if a user chooses to save the search session, the saved object is persisted, so that results can be restored in a later time.
Stored search sessions are listed in the *Management* application, under *Kibana > Search Sessions*, making it easy to find, manage, and restore them. Stored search sessions are listed in the _Management_ application, under _Kibana > Search Sessions_, making it easy to find, manage, and restore them.
As a developer, you might encounter these two common, use cases: As a developer, you might encounter these two common, use cases:
* Running a search inside an existing search session - Running a search inside an existing search session
* Supporting search sessions in your application - Supporting search sessions in your application
#### Running a search inside an existing search session #### Running a search inside an existing search session
@ -340,9 +339,7 @@ Because the Dashboard application is already managing a search session, all you
The search information will be added to the saved object for the search session. The search information will be added to the saved object for the search session.
```ts ```ts
export class SearchEmbeddable export class SearchEmbeddable extends Embeddable<MyInput, MyOutput> {
extends Embeddable<MyInput, MyOutput> {
private async fetchData() { private async fetchData() {
// Every embeddable receives an optional `searchSessionId` input parameter. // Every embeddable receives an optional `searchSessionId` input parameter.
const { searchSessionId } = this.input; const { searchSessionId } = this.input;
@ -355,9 +352,11 @@ export class SearchEmbeddable
this.updateOutput({ loading: true, error: undefined }); this.updateOutput({ loading: true, error: undefined });
// Make the request, wait for the final result // Make the request, wait for the final result
const {rawResponse: resp} = await searchSource.fetch$({ const { rawResponse: resp } = await searchSource
.fetch$({
sessionId: searchSessionId, sessionId: searchSessionId,
}).toPromise(); })
.toPromise();
this.useSearchResult(resp); this.useSearchResult(resp);
@ -368,7 +367,6 @@ export class SearchEmbeddable
} }
} }
} }
``` ```
You can also retrieve the active `Search Session ID` from the `Search Service` directly: You can also retrieve the active `Search Session ID` from the `Search Service` directly:
@ -376,18 +374,21 @@ You can also retrieve the active `Search Session ID` from the `Search Service` d
```ts ```ts
async function fetchData(data: DataPublicPluginStart) { async function fetchData(data: DataPublicPluginStart) {
try { try {
return await searchSource.fetch$({ return await searchSource
.fetch$({
sessionId: data.search.sessions.getSessionId(), sessionId: data.search.sessions.getSessionId(),
}).toPromise(); })
.toPromise();
} catch (e) { } catch (e) {
// handle search errors // handle search errors
} }
} }
``` ```
<DocCallOut title="Search Sessions with Server Side Search"> <DocCallOut title="Search Sessions with Server Side Search">
Search sessions are initiated by the client. If you are using a route that runs server side searches, you can send the `searchSessionId` to the server, and then pass it down to the server side `data.search` function call. Search sessions are initiated by the client. If you are using a route that runs server side
searches, you can send the `searchSessionId` to the server, and then pass it down to the server
side `data.search` function call.
</DocCallOut> </DocCallOut>
#### Supporting search sessions in your application #### Supporting search sessions in your application
@ -409,8 +410,8 @@ export class MyPlugin implements Plugin {
public start(core: CoreStart, { data }: MyPluginStartDependencies) { public start(core: CoreStart, { data }: MyPluginStartDependencies) {
const sessionRestorationDataProvider: SearchSessionInfoProvider = { const sessionRestorationDataProvider: SearchSessionInfoProvider = {
data, data,
getDashboard getDashboard,
} };
data.search.session.enableStorage({ data.search.session.enableStorage({
getName: async () => { getName: async () => {
@ -430,11 +431,16 @@ export class MyPlugin implements Plugin {
``` ```
<DocCallOut title="Search sessions restore state"> <DocCallOut title="Search sessions restore state">
The restore state of a search session may be different from the initial state used to create it. For example, where the initial state may contain relative dates, in the restore state, those must be converted to absolute dates. Read more about the [NowProvider](). The restore state of a search session may be different from the initial state used to create it.
For example, where the initial state may contain relative dates, in the restore state, those must
be converted to absolute dates. Read more about the [NowProvider]().
</DocCallOut> </DocCallOut>
<DocCallOut color="danger" title="Search sessions indicator"> <DocCallOut color="danger" title="Search sessions indicator">
Calling `enableStorage` will also enable the `Search Session Indicator` component in the chrome component of your solution. The `Search Session Indicator` is a small button, used by default to engage users and save new search sessions. To implement your own UI, contact the Kibana application services team to decouple this behavior. Calling `enableStorage` will also enable the `Search Session Indicator` component in the chrome
component of your solution. The `Search Session Indicator` is a small button, used by default to
engage users and save new search sessions. To implement your own UI, contact the Kibana
application services team to decouple this behavior.
</DocCallOut> </DocCallOut>
##### Start a new search session ##### Start a new search session
@ -442,11 +448,9 @@ export class MyPlugin implements Plugin {
Make sure to call `start` when the **state** you previously defined changes. Make sure to call `start` when the **state** you previously defined changes.
```ts ```ts
function onSearchSessionConfigChange() { function onSearchSessionConfigChange() {
this.searchSessionId = data.search.sessions.start(); this.searchSessionId = data.search.sessions.start();
} }
``` ```
Pass the `searchSessionId` to every `search` call inside your application. If you're using `Embeddables`, pass down the `searchSessionId` as `input`. Pass the `searchSessionId` to every `search` call inside your application. If you're using `Embeddables`, pass down the `searchSessionId` as `input`.
@ -455,7 +459,6 @@ If you can't pass the `searchSessionId` directly, you can retrieve it from the s
```ts ```ts
const currentSearchSessionId = data.search.sessions.getSessionId(); const currentSearchSessionId = data.search.sessions.getSessionId();
``` ```
##### Clear search sessions ##### Clear search sessions
@ -466,7 +469,6 @@ Creating a new search session clears the previous one. You must explicitly `clea
function onDestroy() { function onDestroy() {
data.search.session.clear(); data.search.session.clear();
} }
``` ```
If you don't call `clear`, you will see a warning in the console while developing. However, when running in production, you will get a fatal error. This is done to avoid leakage of unrelated search requests into an existing search session left open by mistake. If you don't call `clear`, you will see a warning in the console while developing. However, when running in production, you will get a fatal error. This is done to avoid leakage of unrelated search requests into an existing search session left open by mistake.
@ -478,7 +480,6 @@ The last step of the integration is restoring an existing search session. The `
If you detect the presense of a `searchSessionId` parameter in the URL, call the `restore` method **instead** of calling `start`. The previous example would now become: If you detect the presense of a `searchSessionId` parameter in the URL, call the `restore` method **instead** of calling `start`. The previous example would now become:
```ts ```ts
function onSearchSessionConfigChange(searchSessionIdFromUrl?: string) { function onSearchSessionConfigChange(searchSessionIdFromUrl?: string) {
if (searchSessionIdFromUrl) { if (searchSessionIdFromUrl) {
data.search.sessions.restore(searchSessionIdFromUrl); data.search.sessions.restore(searchSessionIdFromUrl);
@ -486,7 +487,6 @@ function onSearchSessionConfigChange(searchSessionIdFromUrl?: string) {
data.search.sessions.start(); data.search.sessions.start();
} }
} }
``` ```
Once you `restore` the session, as long as all `search` requests run with the same `searchSessionId`, the search session should be seamlessly restored. Once you `restore` the session, as long as all `search` requests run with the same `searchSessionId`, the search session should be seamlessly restored.

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevTutorialDebugging id: kibDevTutorialDebugging
slug: /kibana-dev-docs/tutorial/debugging slug: /kibana-dev-docs/tutorials/debugging
title: Debugging in development title: Debugging in development
summary: Learn how to debug Kibana while running from source summary: Learn how to debug Kibana while running from source
date: 2021-04-26 date: 2021-04-26

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevTutorialSavedObject id: kibDevTutorialSavedObject
slug: /kibana-dev-docs/tutorial/saved-objects slug: /kibana-dev-docs/tutorials/saved-objects
title: Register a new saved object type title: Register a new saved object type
summary: Learn how to register a new saved object type. summary: Learn how to register a new saved object type.
date: 2021-02-05 date: 2021-02-05

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevTutorialSubmitPullRequest id: kibDevTutorialSubmitPullRequest
slug: /kibana-dev-docs/tutorial/submit-pull-request slug: /kibana-dev-docs/tutorials/submit-pull-request
title: Submitting a Kibana pull request title: Submitting a Kibana pull request
summary: Learn how to submit a Kibana pull request summary: Learn how to submit a Kibana pull request
date: 2021-06-24 date: 2021-06-24

View file

@ -1,6 +1,6 @@
--- ---
id: kibDevTutorialTestingPlugins id: kibDevTutorialTestingPlugins
slug: /kibana-dev-docs/tutorial/testing-plugins slug: /kibana-dev-docs/tutorials/testing-plugins
title: Testing Kibana Plugins title: Testing Kibana Plugins
summary: Learn how to test different aspects of Kibana plugins summary: Learn how to test different aspects of Kibana plugins
date: 2021-07-05 date: 2021-07-05

View file

@ -1,3 +1,3 @@
# Kibana RFCs # Kibana RFCs
We no longer follow this RFC process. Internal developers should review the new RFC process in our [internal developer guide](https://docs.elastic.dev/kibana-team/rfc-process) We no longer follow this RFC process. Internal developers should review the new RFC process in our [internal developer guide](https://docs.elastic.dev/kibana-dev-docs/contributing/rfc-process)

View file

@ -1,6 +1,6 @@
--- ---
id: kibDataPlugin id: kibDataPlugin
slug: /kibana-dev-docs/services/data-plugin slug: /kibana-dev-docs/key-concepts/data-plugin
title: Data services title: Data services
image: https://source.unsplash.com/400x175/?Search image: https://source.unsplash.com/400x175/?Search
summary: The data plugin contains services for searching, querying and filtering. summary: The data plugin contains services for searching, querying and filtering.

View file

@ -1,6 +1,6 @@
--- ---
id: kibUsageCollectionPlugin id: kibUsageCollectionPlugin
slug: /kibana-dev-docs/services/usage-collection-plugin slug: /kibana-dev-docs/key-concepts/usage-collection-plugin
title: Usage collection service title: Usage collection service
summary: The Usage Collection Service defines a set of APIs for other plugins to report the usage of their features. summary: The Usage Collection Service defines a set of APIs for other plugins to report the usage of their features.
date: 2021-02-24 date: 2021-02-24