diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 7a21d792e7270..041ae25f1d7f4 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -57,6 +57,7 @@
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/ui_actions_enhanced/ @elastic/kibana-app-services
+/x-pack/plugins/runtime_fields @elastic/kibana-app-services
#CC# /src/plugins/bfetch/ @elastic/kibana-app-services
#CC# /src/plugins/index_pattern_management/ @elastic/kibana-app-services
#CC# /src/plugins/inspector/ @elastic/kibana-app-services
@@ -207,6 +208,7 @@
#CC# /src/legacy/server/http/ @elastic/kibana-core
#CC# /src/legacy/ui/public/documentation_links @elastic/kibana-core
#CC# /src/plugins/legacy_export/ @elastic/kibana-core
+#CC# /src/plugins/xpack_legacy/ @elastic/kibana-core
#CC# /src/plugins/saved_objects/ @elastic/kibana-core
#CC# /src/plugins/status_page/ @elastic/kibana-core
#CC# /x-pack/plugins/cloud/ @elastic/kibana-core
diff --git a/dev_docs/kibana_server_core_components.mdx b/dev_docs/kibana_server_core_components.mdx
index 701043059be02..503d8401d4492 100644
--- a/dev_docs/kibana_server_core_components.mdx
+++ b/dev_docs/kibana_server_core_components.mdx
@@ -1,7 +1,7 @@
---
id: kibServerAndCoreComponents
slug: /kibana-dev-docs/core-intro
-title: Core components
+title: Kibana Server and Core components
summary: An introduction to the Kibana server and core components.
date: 2021-02-26
tags: ['kibana','onboarding', 'dev', 'architecture']
@@ -9,22 +9,8 @@ tags: ['kibana','onboarding', 'dev', 'architecture']
Core is a set of systems (frontend, backend etc.) that Kibana and its plugins are built on top of.
-## Integration with the "legacy" Kibana
-
-Most of the existing core functionality is still spread over "legacy" Kibana and it will take some time to upgrade it.
-Kibana is started using existing "legacy" CLI that bootstraps `core` which in turn creates the "legacy" Kibana server.
-At the moment `core` manages HTTP connections, handles TLS configuration and base path proxy. All requests to Kibana server
-will hit HTTP server exposed by the `core` first and it will decide whether request can be solely handled by the new
-platform or request should be proxied to the "legacy" Kibana. This setup allows `core` to gradually introduce any "pre-route"
-processing logic, expose new routes or replace old ones handled by the "legacy" Kibana currently.
-
-Once config has been loaded and some of its parts were validated by the `core` it's passed to the "legacy" Kibana where
-it will be additionally validated so that we can make config validation stricter with the new config validation system.
-Even though the new validation system provided by the `core` is also based on Joi internally it is complemented with custom
-rules tailored to our needs (e.g. `byteSize`, `duration` etc.). That means that config values that were previously accepted
-by the "legacy" Kibana may be rejected by the `core` now.
-
### Logging
`core` has its own and will output log records directly (e.g. to file or terminal) when configured. When no specific configuration is provided, logs are forwarded to the "legacy" Kibana so that they look the same as the rest of the
log records throughout Kibana.
+Other components
diff --git a/docs/discover/context.asciidoc b/docs/discover/context.asciidoc
new file mode 100644
index 0000000000000..9131c81781fc8
--- /dev/null
+++ b/docs/discover/context.asciidoc
@@ -0,0 +1,60 @@
+[[discover-document-context]]
+== View surrounding documents
+
+Once you've narrowed your search to a specific event in *Discover*,
+you can inspect the documents that occurred
+immediately before and after the event.
+To view the surrounding documents, your index pattern must contain time-based events.
+
+. In the document table, click the expand icon (>).
+. Click *View surrounding documents.*
++
+In the context view, documents are sorted by the time field specified in the index pattern
+and displayed using the same set of columns as the *Discover* view from which
+the context was opened. The anchor document is highlighted in blue.
++
+[role="screenshot"]
+image::images/discover-context.png[Image showing context view feature, with anchor documents highlighted in blue]
++
+The filters you applied in *Discover* are carried over to the context view. Pinned
+filters remain active, while normal filters are copied in a disabled state.
+
++
+[role="screenshot"]
+image::images/discover-context-filters-inactive.png[Filter in context view]
+
+. To find the documents of interest, add filters.
+
+. To increase the number of documents that surround the anchor document, click *Load*.
+By default, five documents are added with each click.
++
+[role="screenshot"]
+image::images/discover-context-load-newer-documents.png[Load button and the number of documents to load]
+
+
+[float]
+[[configure-context-ContextView]]
+=== Configure the context view
+
+Configure the appearance and behavior in *Advanced Settings*.
+
+. Open the main menu, then click *Stack Management > Advanced Settings*.
+. Search for `context`, then edit the settings.
++
+[horizontal]
+`context:defaultSize`:: The number of documents to display by default.
+`context:step`:: The default number of documents to load with each button click. The default is 5.
+`context:tieBreakerFields`:: The field to use for tiebreaking in case of equal time field values.
+The default is the `_doc` field.
++
+You can enter a comma-separated list of field
+names, which is checked in sequence for suitability when a context is
+displayed. The first suitable field is used as the tiebreaking
+field. A field is suitable if the field exists and is sortable in the index
+pattern the context is based on.
++
+Although not required, it is recommended to only
+use fields that have {ref}/doc-values.html[doc values] enabled to achieve
+good performance and avoid unnecessary {ref}/modules-fielddata.html[field
+data] usage. Common examples for suitable fields include log line numbers,
+monotonically increasing counters and high-precision timestamps.
\ No newline at end of file
diff --git a/docs/discover/images/Discover-ContextView.png b/docs/discover/images/Discover-ContextView.png
deleted file mode 100644
index b9682764f4575..0000000000000
Binary files a/docs/discover/images/Discover-ContextView.png and /dev/null differ
diff --git a/docs/discover/images/discover-context-filters-active.png b/docs/discover/images/discover-context-filters-active.png
new file mode 100644
index 0000000000000..9aa70ab138b03
Binary files /dev/null and b/docs/discover/images/discover-context-filters-active.png differ
diff --git a/docs/discover/images/discover-context-filters-inactive.png b/docs/discover/images/discover-context-filters-inactive.png
new file mode 100644
index 0000000000000..c53a8cedff336
Binary files /dev/null and b/docs/discover/images/discover-context-filters-inactive.png differ
diff --git a/docs/discover/images/discover-context-load-newer-documents.png b/docs/discover/images/discover-context-load-newer-documents.png
new file mode 100644
index 0000000000000..9c4a74d39b3c9
Binary files /dev/null and b/docs/discover/images/discover-context-load-newer-documents.png differ
diff --git a/docs/discover/images/discover-context.png b/docs/discover/images/discover-context.png
new file mode 100644
index 0000000000000..8ce68047e0d76
Binary files /dev/null and b/docs/discover/images/discover-context.png differ
diff --git a/docs/user/discover.asciidoc b/docs/user/discover.asciidoc
index 42ac1e22ce167..11abe975374e5 100644
--- a/docs/user/discover.asciidoc
+++ b/docs/user/discover.asciidoc
@@ -161,7 +161,8 @@ image:images/document-table-expanded.png[Table view with document expanded]
. Scan through the fields and their values. If you find a field of interest,
hover of its name for filters and other controls.
-. To view documents that occurred before or after the event you are looking at, click **View surrounding documents**.
+. To view documents that occurred before or after the event you are looking at, click
+<>.
. For direct access to a particular document, click **View single document**.
+
@@ -218,4 +219,6 @@ include::{kib-repo-dir}/discover/set-time-filter.asciidoc[]
include::{kib-repo-dir}/discover/search.asciidoc[]
+include::{kib-repo-dir}/discover/context.asciidoc[]
+
include::{kib-repo-dir}/discover/search-for-relevance.asciidoc[]
diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts
index f3b12cceadcb6..28d72ef844615 100644
--- a/x-pack/test/functional/page_objects/graph_page.ts
+++ b/x-pack/test/functional/page_objects/graph_page.ts
@@ -26,6 +26,7 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'header']);
const retry = getService('retry');
+ const browser = getService('browser');
class GraphPage {
async selectIndexPattern(pattern: string) {
@@ -124,9 +125,12 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon
async getGraphObjects() {
await this.stopLayout();
- const graphElements = await find.allByCssSelector(
- '#graphSvg line, #graphSvg circle, #graphSvg text.gphNode__label'
- );
+ // read node labels directly from DOM because getVisibleText is not reliable for the way the graph is rendered
+ const nodeNames: string[] = await browser.execute(`
+ const elements = document.querySelectorAll('#graphSvg text.gphNode__label');
+ return [...elements].map(element => element.innerHTML);
+ `);
+ const graphElements = await find.allByCssSelector('#graphSvg line, #graphSvg circle');
const nodes: Node[] = [];
const nodePositionMap: Record = {};
const edges: Edge[] = [];
@@ -136,15 +140,10 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon
const tagName: string = await element.getTagName();
// check the position of the circle element
if (tagName === 'circle') {
- nodes.push({ circle: element, label: '' });
+ nodes.push({ circle: element, label: nodeNames[nodes.length] });
const position = await this.getCirclePosition(element);
nodePositionMap[position] = nodes.length - 1;
}
- // get the label for the node from the text element
- if (tagName === 'text') {
- const text = await element.getVisibleText();
- nodes[nodes.length - 1].label = text;
- }
}
// find all edges