Skip to content

Commit

Permalink
Merge branch 'main' into kbn-117255-apm-agent-jest-leak
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Dec 3, 2021
2 parents ec81523 + 89b1f90 commit 05d9353
Show file tree
Hide file tree
Showing 882 changed files with 16,820 additions and 13,187 deletions.
5 changes: 5 additions & 0 deletions .buildkite/scripts/build_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ if [[ "${GITHUB_PR_LABELS:-}" == *"ci:deploy-cloud"* ]]; then
--skip-docker-ubi \
--skip-docker-centos \
--skip-docker-contexts

CLOUD_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" docker.elastic.co/kibana-ci/kibana-cloud)
cat << EOF | buildkite-agent annotate --style "info" --context cloud-image
Cloud image: $CLOUD_IMAGE
EOF
fi

echo "--- Archive Kibana Distribution"
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

# Vis Editors
/x-pack/plugins/lens/ @elastic/kibana-vis-editors
/src/plugins/advanced_settings/ @elastic/kibana-vis-editors
/src/plugins/charts/ @elastic/kibana-vis-editors
/src/plugins/vis_default_editor/ @elastic/kibana-vis-editors
/src/plugins/vis_types/metric/ @elastic/kibana-vis-editors
Expand Down Expand Up @@ -263,6 +262,7 @@
/src/plugins/home/server/*.ts @elastic/kibana-core
/src/plugins/home/server/services/ @elastic/kibana-core
/src/plugins/kibana_overview/ @elastic/kibana-core
/src/plugins/advanced_settings/ @elastic/kibana-core
/x-pack/plugins/global_search_bar/ @elastic/kibana-core
#CC# /src/core/server/csp/ @elastic/kibana-core
#CC# /src/plugins/saved_objects/ @elastic/kibana-core
Expand Down
8 changes: 8 additions & 0 deletions dev_docs/contributing/standards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ Every public API should have a release tag specified at the top of it’s docume

Every team should be collecting telemetry metrics on it’s public API usage. This will be important for knowing when it’s safe to make breaking changes. The Core team will be looking into ways to make this easier and an automatic part of registration (see [#112291](https://github.com/elastic/kibana/issues/112291)).

### APM

Kibana server and client are instrumented with APM node and APM RUM clients respectively, tracking serveral types of transactions by default, such as `page-load`, `request`, etc.
You may introduce custom transactions. Please refer to the [APM documentation](https://www.elastic.co/guide/en/apm/get-started/current/index.html) and follow these guidelines when doing so:

- Use dashed syntax for transaction types and names: `my-transaction-type` and `my-transaction-name`
- [Refrain from adding too many custom labels](https://www.elastic.co/guide/en/apm/get-started/current/metadata.html)

### Documentation

Every public API should be documented inside the [docs/api](https://github.com/elastic/kibana/tree/main/docs/api) folder in asciidoc (this content will eventually be migrated to mdx to support the new docs system). If a public REST API is undocumented, you should either document it, or make it internal.
Expand Down
2 changes: 1 addition & 1 deletion dev_docs/key_concepts/building_blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Check out <DocLink id="kibDevDocsKPTTutorial" text="the KibanaPageTemplate tutor

### Index Patterns

<DocLink id="kibDataPlugin" section="index-patterns-api" text="Index Patterns" /> are a high-level, space-aware
<DocLink id="kibDataPlugin" section="data-views-api" text="Index Patterns" /> are a high-level, space-aware
abstraction layer that sits above Data Streams and Elasticsearch indices. Index Patterns provide users
the 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, and they can customize the field list with runtime fields,
Expand Down
2 changes: 1 addition & 1 deletion dev_docs/tutorials/data_views.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ await data.indexPatterns.delete(dataViewId);

### Data view HTTP API

Rest-like HTTP CRUD+ API - [docs](https://www.elastic.co/guide/en/kibana/master/index-patterns-api.html)
Rest-like HTTP CRUD+ API - [docs](https://www.elastic.co/guide/en/kibana/master/data-views-api.html)
2 changes: 2 additions & 0 deletions dev_docs/tutorials/saved_objects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ Having said that, if a document is encountered that is not in the expected shape
fail an upgrade than to silently ignore a corrupt document which can cause unexpected behaviour at some future point in time. When such a scenario is encountered,
the error should be verbose and informative so that the corrupt document can be corrected, if possible.

**WARNING:** Do not attempt to change the `migrationVersion`, `id`, or `type` fields within a migration function, this is not supported.

### Testing Migrations

Bugs in a migration function cause downtime for our users and therefore have a very high impact. Follow the <DocLink id="kibDevTutorialTestingPlugins" section="saved-objects-migrations" text="Saved Object migrations section in the plugin testing guide"/>.
2 changes: 1 addition & 1 deletion docs/api/dashboard-api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
deprecated::[7.15.0,Both of these APIs have been deprecated in favor of <<saved-objects-api-import>> and <<saved-objects-api-export>>.]

Import and export dashboards with the corresponding saved objects, such as visualizations, saved
searches, and index patterns.
searches, and data views.

WARNING: Do not write documents directly to the `.kibana` index. When you write directly
to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions.
Expand Down
42 changes: 42 additions & 0 deletions docs/api/data-views.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[[data-views-api]]
== Data views API

experimental[] Manage data views, formerly known as {kib} index patterns.

WARNING: Do not write documents directly to the `.kibana` index. When you write directly
to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions.

WARNING: Use the data views APIs for managing data views instead of lower-level <<saved-objects-api, saved objects API>>.

The following data views APIs are available:

* Data views
** <<data-views-api-get, Get data view API>> to retrieve a single data view
** <<data-views-api-create, Create data view API>> to create data view
** <<data-views-api-update, Update data view API>> to partially updated data view
** <<data-views-api-delete, Delete data view API>> to delete a data view
* Default data views
** <<data-views-api-default-get, Get default data view API>> to retrieve a default data view
** <<data-views-api-default-set, Set default data view API>> to set a default data view
* Fields
** <<data-views-fields-api-update, Update data view field>> to change field metadata, such as `count`, `customLabel` and `format`
* Runtime fields
** <<data-views-runtime-field-api-get, Get runtime field API>> to retrieve a runtime field
** <<data-views-runtime-field-api-create, Create runtime field API>> to create a runtime field
** <<data-views-runtime-field-api-upsert, Upsert runtime field API>> to create or update a runtime field
** <<data-views-runtime-field-api-update, Update runtime field API>> to partially update an existing runtime field
** <<data-views-runtime-field-api-delete, Delete runtime field API>> to delete a runtime field

include::data-views/get.asciidoc[]
include::data-views/create.asciidoc[]
include::data-views/update.asciidoc[]
include::data-views/delete.asciidoc[]
include::data-views/default-get.asciidoc[]
include::data-views/default-set.asciidoc[]
include::data-views/update-fields.asciidoc[]
include::data-views/runtime-fields/get.asciidoc[]
include::data-views/runtime-fields/create.asciidoc[]
include::data-views/runtime-fields/upsert.asciidoc[]
include::data-views/runtime-fields/update.asciidoc[]
include::data-views/runtime-fields/delete.asciidoc[]

Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
[[index-patterns-api-create]]
=== Create index pattern API
[[data-views-api-create]]
=== Create data view API
++++
<titleabbrev>Create index pattern</titleabbrev>
<titleabbrev>Create data view</titleabbrev>
++++

experimental[] Create {kib} index patterns.
experimental[] Create data views.

[[index-patterns-api-create-request]]
[[data-views-api-create-request]]
==== Request

`POST <kibana host>:<port>/api/index_patterns/index_pattern`

`POST <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern`

[[index-patterns-api-create-path-params]]
[[data-views-api-create-path-params]]
==== Path parameters

`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.

[[index-patterns-api-create-body-params]]
[[data-views-api-create-body-params]]
==== Request body

`override`:: (Optional, boolean) Overrides an existing index pattern if an
index pattern with the provided title already exists. The default is `false`.
`override`:: (Optional, boolean) Overrides an existing data view if a
data view with the provided title already exists. The default is `false`.

`refresh_fields`:: (Optional, boolean) Reloads index pattern fields after
the index pattern is stored. The default is `false`.
`refresh_fields`:: (Optional, boolean) Reloads data view fields after
the data view is stored. The default is `false`.

`index_pattern`:: (Required, object) The index pattern object. All fields are optional.
`index_pattern`:: (Required, object) The data view object. All fields are optional.

[[index-patterns-api-create-request-codes]]
[[data-views-api-create-request-codes]]
==== Response code

`200`::
Indicates a successful call.

[[index-patterns-api-create-example]]
[[data-views-api-create-example]]
==== Examples

Create an index pattern with a custom title:
Create a data view with a custom title:

[source,sh]
--------------------------------------------------
Expand Down Expand Up @@ -67,7 +67,7 @@ $ curl -X POST api/index_patterns/index_pattern
--------------------------------------------------
// KIBANA

At creation, all index pattern fields are optional:
At creation, all data view fields are optional:

[source,sh]
--------------------------------------------------
Expand All @@ -92,7 +92,7 @@ $ curl -X POST api/index_patterns/index_pattern
// KIBANA


The API returns the index pattern object:
The API returns the data view object:

[source,sh]
--------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
[[index-patterns-api-default-get]]
=== Get default index pattern API
[[data-views-api-default-get]]
=== Get default data view API
++++
<titleabbrev>Get default index pattern</titleabbrev>
<titleabbrev>Get default data view</titleabbrev>
++++

experimental[] Retrieve a default index pattern ID. Kibana UI uses default index pattern unless user picks a different one.
experimental[] Retrieve a default data view ID. Kibana UI uses the default data view unless user picks a different one.

[[index-patterns-api-default-get-request]]
[[data-views-api-default-get-request]]
==== Request

`GET <kibana host>:<port>/api/index_patterns/default`

`GET <kibana host>:<port>/s/<space_id>/api/index_patterns/default`

[[index-patterns-api-default-get-params]]
[[data-views-api-default-get-params]]
==== Path parameters

`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.

[[index-patterns-api-default-get-codes]]
[[data-views-api-default-get-codes]]
==== Response code

`200`::
Indicates a successful call.

[[index-patterns-api-default-get-example]]
[[data-views-api-default-get-example]]
==== Example

Retrieve the default index pattern id:
Retrieve the default data view id:

[source,sh]
--------------------------------------------------
$ curl -X GET api/index_patterns/default
--------------------------------------------------
// KIBANA

The API returns an ID of a default index pattern:
The API returns an ID of a default data view:

[source,sh]
--------------------------------------------------
Expand All @@ -45,7 +45,7 @@ The API returns an ID of a default index pattern:
}
--------------------------------------------------

In case there is no default index pattern, the API returns:
In case there is no default data view, the API returns:

[source,sh]
--------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
[[index-patterns-api-default-set]]
=== Set default index pattern API
[[data-views-api-default-set]]
=== Set default data view API
++++
<titleabbrev>Set default index pattern</titleabbrev>
<titleabbrev>Set default data view</titleabbrev>
++++

experimental[] Set a default index pattern ID. Kibana UI will use default index pattern unless user picks a different one.
experimental[] Set a default data view ID. Kibana UI will use the default data view unless user picks a different one.
The API doesn't validate if given `index_pattern_id` is a valid id.

[[index-patterns-api-default-set-request]]
[[data-views-api-default-set-request]]
==== Request

`POST <kibana host>:<port>/api/index_patterns/default`

`POST <kibana host>:<port>/s/<space_id>/api/index_patterns/default`

[[index-patterns-api-default-set-params]]
[[data-views-api-default-set-params]]
==== Path parameters

`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.

[[index-patterns-api-default-set-body]]
[[data-views-api-default-set-body]]
==== Request body

`index_pattern_id`:: (Required, `string` or `null`) Sets a default index pattern id. Use `null` to unset a default index pattern.
`index_pattern_id`:: (Required, `string` or `null`) Sets a default data view id. Use `null` to unset a default data view.

`force`:: (Optional, boolean) Updates existing default index pattern id. The default is `false`.
`force`:: (Optional, boolean) Updates existing default data view id. The default is `false`.


[[index-patterns-api-default-set-codes]]
[[data-views-api-default-set-codes]]
==== Response code

`200`::
Indicates a successful call.

[[index-patterns-api-default-set-example]]
[[data-views-api-default-set-example]]
==== Example

Set the default index pattern id if none is set:
Set the default data view id if none is set:

[source,sh]
--------------------------------------------------
Expand All @@ -49,7 +49,7 @@ $ curl -X POST api/index_patterns/default
// KIBANA


Upsert the default index pattern:
Upsert the default data view:

[source,sh]
--------------------------------------------------
Expand All @@ -61,7 +61,7 @@ $ curl -X POST api/index_patterns/default
--------------------------------------------------
// KIBANA

Unset the default index pattern:
Unset the default data view:

[source,sh]
--------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
[[index-patterns-api-delete]]
=== Delete index pattern API
[[data-views-api-delete]]
=== Delete data view API
++++
<titleabbrev>Delete index pattern</titleabbrev>
<titleabbrev>Delete data view</titleabbrev>
++++

experimental[] Delete {kib} index patterns.
experimental[] Delete data views.

WARNING: Once you delete an index pattern, _it cannot be recovered_.
WARNING: Once you delete a data view, _it cannot be recovered_.

[[index-patterns-api-delete-request]]
[[data-views-api-delete-request]]
==== Request

`DELETE <kibana host>:<port>/api/index_patterns/index_pattern/<id>`

`DELETE <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern/<id>`

[[index-patterns-api-delete-path-params]]
[[data-views-api-delete-path-params]]
==== Path parameters

`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.

`id`::
(Required, string) The ID of the index pattern you want to delete.
(Required, string) The ID of the data view you want to delete.

[[index-patterns-api-delete-response-codes]]
[[data-views-api-delete-response-codes]]
==== Response code

`200`::
Indicates that index pattern is deleted. Returns an empty response body.
Indicates that data view is deleted. Returns an empty response body.

==== Example

Delete an index pattern object with the `my-pattern` ID:
Delete a data view object with the `my-pattern` ID:

[source,sh]
--------------------------------------------------
Expand Down
Loading

0 comments on commit 05d9353

Please sign in to comment.