Skip to content

Commit

Permalink
Merge branch 'main' into eui/41.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsongl authored Nov 16, 2021
2 parents 5b6f387 + 66aca8b commit 132ec86
Show file tree
Hide file tree
Showing 62 changed files with 1,780 additions and 585 deletions.
1 change: 1 addition & 0 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include::{docs-root}/shared/versions/stack/{source_branch}.asciidoc[]
:es-docker-image: {es-docker-repo}:{version}
:blob: {kib-repo}blob/{branch}/
:security-ref: https://www.elastic.co/community/security/
:Data-source: Data view
:data-source: data view
:data-sources: data views
:a-data-source: a data view
Expand Down
22 changes: 18 additions & 4 deletions docs/user/dashboard/dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -361,17 +361,31 @@ To exit *Edit* mode, click *Switch to view mode*.

[float]
[[download-csv]]
== Download panel data
== View the panel data and requests

Download panel data in a CSV file. When you download visualization panels with multiple layers, each layer produces a CSV file, and the file names contain the visualization and layer index names.
View the data in visualizations and the requests that collect the data.

. Open the panel menu, then select *Inspect*.
. Open the panel menu, then click *More > Inspect*.

. Click *Download CSV*, then select the format type from the dropdown:
. View and download the panel data.

.. Open the *View* dropdown, then click *Data*.

.. Click *Download CSV*, then select the format type from the dropdown:

* *Formatted CSV* — Contains human-readable dates and numbers.

* *Unformatted* — Best used for computer use.
+
When you download visualization panels with multiple layers, each layer produces a CSV file, and the file names contain the visualization and layer {data-source} names.

. View the requests that collect the data.

.. Open the *View* dropdown, then click *Requests*.

.. From the dropdown, select the requests you want to view.

.. To view the requests in *Console*, click *Request*, then click *Open in Console*.

[float]
[[share-the-dashboard]]
Expand Down
16 changes: 11 additions & 5 deletions docs/user/dashboard/make-dashboards-interactive.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,26 @@ To save the panel to the dashboard:
[[explore-the-underlying-documents]]
=== Open panel data in Discover

You can add interactions to panels that allow you to open *Discover* and explore the panel data. To use the *Discover* interactions, the panel must use only one index pattern, and you must enable <<settings-explore-data-in-context,`xpack.discoverEnhanced.actions.`>> and <<settings-explore-data-in-chart,`xpack.discoverEnhanced.actions.exploreDataInChart.enabled`>> in kibana.yml.
You can add interactions to panels that allow you to open and explore the data in *Discover*. To use the interactions, the panel must use only one {data-view}.

If you are using 7.13.0 and earlier, panel interactions are enabled by default.
There are three types of *Discover* interactions you can add to dashboards:

There are two types of *Discover* interactions that you can add to dashboards:

* *Panel interactions* &mdash; Opens the panel data in *Discover*, including the dashboard-level filters, but not the panel-level filters.
* *Panel interactions* &mdash; Opens panel data in *Discover*, including the dashboard-level filters, but not the panel-level filters.
+
To enable panel interactions, configure <<settings-explore-data-in-context,`xpack.discoverEnhanced.actions.`>> in kibana.yml. If you are using 7.13.0 and earlier, panel interactions are enabled by default.
+
To use panel interactions, open the panel menu, then click *Explore underlying data*.

* *Series data interactions* &mdash; Opens the series data in *Discover*.
+
To enable series data interactions, configure <<settings-explore-data-in-chart,`xpack.discoverEnhanced.actions.exploreDataInChart.enabled`>> in kibana.yml. If you are using 7.13.0 and earlier, data series interactions are enabled by default.
+
To use series data interactions, click a data series in the panel.

* *Saved search interactions* &mdash; Opens <<save-your-search,saved search>> data in *Discover*.
+
To use saved search interactions, open the panel menu, then click *More > View saved search*.

[float]
[[create-drilldowns]]
=== Create drilldowns
Expand Down
104 changes: 41 additions & 63 deletions docs/user/dashboard/tsvb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,11 @@ With *TSVB*, you can:
[role="screenshot"]
image::images/tsvb-screenshot.png[TSVB overview]

[float]
[[tsvb-required-choices]]
==== Open and set up TSVB

Open *TSVB*, then configure the required settings.

. On the dashboard, click *All types*, then select *TSVB*.

. In *TSVB*, click *Panel options*, then specify the required *Data* settings.

.. From the *Index pattern* dropdown, select the index pattern you want to visualize.
+
To visualize the data in an {es} index, open the *Index pattern selection mode* menu, deselect *Use only {kib} index patterns*, then enter the {es} index.

.. From the *Time field* dropdown, select the field you want to visualize, then enter the field *Interval*.

.. Select a *Drop last bucket* option.
+
By default, *TSVB* drops the last bucket because the time filter intersects the time range of the last bucket. To view the partial data, select *No*.

.. To view a filtered set of documents, enter <<kuery-query, KQL filters>> in the *Panel filter* field.

[float]
[[tsvb-index-pattern-mode]]
==== Change the {data-source} mode
==== Open and set up TSVB

You can create *TSVB* visualizations with only {data-sources}, or {es} index strings.
Open *TSVB*, then configure the required settings. You can create *TSVB* visualizations with only {data-sources}, or {es} index strings.

When you use only {data-sources}, you are able to:

Expand All @@ -53,36 +31,64 @@ When you use only {data-sources}, you are able to:

* Improve performance

IMPORTANT: Creating *TSVB* visualizations with an {es} index string is deprecated. To use an {es} index string, contact your administrator, or go to <<advanced-options, Advanced Settings>> 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:
IMPORTANT: Creating *TSVB* visualizations with an {es} index string is deprecated and will be removed in a fytyre release. By default, you create *TSVB* visualizations with only {data-sources}. To use an {es} index string, contact your administrator, or go to <<advanced-options, Advanced Settings>> and set `metrics:allowStringIndices` to `true`.

. On the dashboard, click *All types*, then select *TSVB*.

. Click *Panel options*, then open the *Index pattern selection mode* options next to the *Index pattern* dropdown.
. In *TSVB*, click *Panel options*, then specify the *Data* settings.

. Select *Use only Kibana index patterns*.
. Open the *Index pattern selection mode* options next to the *Index pattern* dropdown.

. From the *Index pattern* drodpown, select the index pattern, then select the *Time field*.
. Select *Use only {kib} {data-sources}*.

. From the *Index pattern* drodpown, select the {data-source}, then select the *Time field* and *Interval*.

. Select a *Drop last bucket* option.
+
image::images/tsvb_index_pattern_selection_mode.png[Change index pattern selection mode action]
By default, *TSVB* drops the last bucket because the time filter intersects the time range of the last bucket. To view the partial data, select *No*.

. To view a filtered set of documents, enter <<kuery-query, KQL filters>> in the *Panel filter* field.

[float]
[[configure-the-data-series]]
[[tsvb-function-reference]]
==== Configure the series

Each *TSVB* visualization shares the same options to create a *Series*. Each series can be thought of as a separate {es} aggregation.
For each series, the *Options* control the styling and {es} options, and are inherited from *Panel options*.
The *Options* control the styling and {es} options, and are inherited from *Panel options*.
When you have separate options for each series, you can compare different {es} indices, and view two time ranges from the same index.

To configure the value of each series, select the function, then configure the function inputs. Only the last function is displayed.

. From the *Aggregation* dropdown, select the function for the series.
. From the *Aggregation* dropdown, select the function for the series. *TSVB* provides you with shortcuts for some frequently-used functions:
+
*Filter Ratio*::
Returns a percent value by calculating a metric on two sets of documents.
For example, calculate the error rate as a percentage of the overall events over time.
+
*Counter Rate*::
Used when dealing with monotonically increasing counters. Shortcut for *Max*, *Derivative*, and *Positive Only*.
+
*Positive Only*::
Removes any negative values from the results, which can be used as a post-processing step
after a derivative.
+
*Series Agg*::
Applies a function to all of the *Group by* series to reduce the values to a single number.
This function must always be the last metric in the series.
For example, if the *Time Series* visualization shows 10 series, the sum *Series Agg* calculates
the sum of all 10 bars and outputs a single Y value per X value. This is often confused
with the overall sum function, which outputs a single Y value per unique series.
+
*Math*::
For each series, apply simple and advanced calculations. Only use *Math* for the last function in a series.

. To display each group separately, select one of the following options from the *Group by* dropdown:

* *Filters* &mdash; Groups the data into the specified filters. To differentiate the groups, assign a color to each filter.

* *Terms* &mdash; Displays the top values of the field. The color is only configurable in the *Time Series* chart. To configure, click *Options*, then select an option from the *Split color theme* dropdown.

. Click *Options*, then configure the inputs for the function.
. Click *Options*, then configure the inputs for the function. For example, to use a different field format, make a selection from the *Data formatter* dropdown.

[float]
[[configure-the-visualizations]]
Expand Down Expand Up @@ -124,37 +130,9 @@ To change this behavior, click *Panel options*, then specify a URL in the *Item

The *Markdown* visualization supports Markdown with Handlebar (mustache) syntax to insert dynamic data, and supports custom CSS.

[float]
[[tsvb-function-reference]]
==== TSVB function reference

*TSVB* provides you with shortcuts for some frequently-used functions.

*Filter Ratio*::
Returns a percent value by calculating a metric on two sets of documents.
For example, calculate the error rate as a percentage of the overall events over time.

*Counter Rate*::
Used when dealing with monotonically increasing counters. Shortcut for *Max*, *Derivative*, and *Positive Only*.

*Positive Only*::
Removes any negative values from the results, which can be used as a post-processing step
after a derivative.

*Series Agg*::
Applies a function to all of the *Group by* series to reduce the values to a single number.
This function must always be the last metric in the series.
For example, if the *Time Series* visualization shows 10 series, the sum *Series Agg* calculates
the sum of all 10 bars and output a single Y value per X value. This is often confused
with the overall sum function, which outputs a single Y value per unique series.

*Math*::
The math context is able to do simple and advanced calculations per series.
This function must always be the last metric in the series.

[float]
[[save-the-tsvb-panel]]
===== Save and add the panel
==== Save and add the panel

Save the panel to the *Visualize Library* and add it to the dashboard, or add it to the dashboard without saving.

Expand Down
37 changes: 20 additions & 17 deletions test/functional/apps/discover/_discover_histogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
import { TimeStrings } from '../../page_objects/common_page';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
Expand Down Expand Up @@ -40,10 +41,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'test/functional/fixtures/es_archiver/long_window_logstash_index_pattern'
);
await security.testUser.restoreDefaults();
await PageObjects.common.unsetTime();
});

async function prepareTest(fromTime: string, toTime: string, interval?: string) {
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
async function prepareTest(time: TimeStrings, interval?: string) {
await PageObjects.common.setTime(time);
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.waitUntilSearchingHasFinished();
if (interval) {
await PageObjects.discover.setChartInterval(interval);
Expand All @@ -52,32 +55,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
}

it('should visualize monthly data with different day intervals', async () => {
const fromTime = 'Nov 1, 2017 @ 00:00:00.000';
const toTime = 'Mar 21, 2018 @ 00:00:00.000';
await prepareTest(fromTime, toTime, 'Month');
const from = 'Nov 1, 2017 @ 00:00:00.000';
const to = 'Mar 21, 2018 @ 00:00:00.000';
await prepareTest({ from, to }, 'Month');
const chartCanvasExist = await elasticChart.canvasExists();
expect(chartCanvasExist).to.be(true);
});
it('should visualize weekly data with within DST changes', async () => {
const fromTime = 'Mar 1, 2018 @ 00:00:00.000';
const toTime = 'May 1, 2018 @ 00:00:00.000';
await prepareTest(fromTime, toTime, 'Week');
const from = 'Mar 1, 2018 @ 00:00:00.000';
const to = 'May 1, 2018 @ 00:00:00.000';
await prepareTest({ from, to }, 'Week');
const chartCanvasExist = await elasticChart.canvasExists();
expect(chartCanvasExist).to.be(true);
});
it('should visualize monthly data with different years scaled to 30 days', async () => {
const fromTime = 'Jan 1, 2010 @ 00:00:00.000';
const toTime = 'Mar 21, 2019 @ 00:00:00.000';
await prepareTest(fromTime, toTime, 'Day');
const from = 'Jan 1, 2010 @ 00:00:00.000';
const to = 'Mar 21, 2019 @ 00:00:00.000';
await prepareTest({ from, to }, 'Day');
const chartCanvasExist = await elasticChart.canvasExists();
expect(chartCanvasExist).to.be(true);
const chartIntervalIconTip = await PageObjects.discover.getChartIntervalWarningIcon();
expect(chartIntervalIconTip).to.be(true);
});
it('should allow hide/show histogram, persisted in url state', async () => {
const fromTime = 'Jan 1, 2010 @ 00:00:00.000';
const toTime = 'Mar 21, 2019 @ 00:00:00.000';
await prepareTest(fromTime, toTime);
const from = 'Jan 1, 2010 @ 00:00:00.000';
const to = 'Mar 21, 2019 @ 00:00:00.000';
await prepareTest({ from, to });
let canvasExists = await elasticChart.canvasExists();
expect(canvasExists).to.be(true);
await testSubjects.click('discoverChartOptionsToggle');
Expand All @@ -95,10 +98,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(canvasExists).to.be(true);
});
it('should allow hiding the histogram, persisted in saved search', async () => {
const fromTime = 'Jan 1, 2010 @ 00:00:00.000';
const toTime = 'Mar 21, 2019 @ 00:00:00.000';
const from = 'Jan 1, 2010 @ 00:00:00.000';
const to = 'Mar 21, 2019 @ 00:00:00.000';
const savedSearch = 'persisted hidden histogram';
await prepareTest(fromTime, toTime);
await prepareTest({ from, to });
await testSubjects.click('discoverChartOptionsToggle');
await testSubjects.click('discoverChartToggle');
let canvasExists = await elasticChart.canvasExists();
Expand Down
18 changes: 17 additions & 1 deletion test/functional/services/query_bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,24 @@ export class QueryBarService extends FtrService {
expect((await queryLanguageButton.getVisibleText()).toLowerCase()).to.eql(lang);
}

public async getSuggestions() {
/**
* Returns the currently shown suggestions texts of the query bar. Since there is no loading
* indicator to wait for to validate if suggestion loading is done, this method is private
* and should not be used in tests. Instead {@link #expectSuggestions} should be used, which
* properly waits for the expected suggestions.
*/
private async getSuggestions() {
const suggestions = await this.testSubjects.findAll('autoCompleteSuggestionText');
return Promise.all(suggestions.map((suggestion) => suggestion.getVisibleText()));
}

public async expectSuggestions({ count, contains }: { count: number; contains?: string }) {
await this.retry.try(async () => {
const suggestions = await this.getSuggestions();
expect(suggestions.length).to.be(count);
if (contains) {
expect(suggestions).to.contain(contains);
}
});
}
}
5 changes: 3 additions & 2 deletions x-pack/plugins/apm/public/tutorial/config_agent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { i18n } from '@kbn/i18n';
import { HttpStart } from 'kibana/public';
import React, { useEffect, useMemo, useState } from 'react';
import styled from 'styled-components';
import { APIReturnType } from '../..//services/rest/createCallApmApi';
import { SUPPORTED_APM_PACKAGE_VERSION } from '../../../common/fleet';
import { APIReturnType } from '../../services/rest/createCallApmApi';
import { getCommands } from './commands/get_commands';
import { getPolicyOptions, PolicyOption } from './get_policy_options';
import { PolicySelector } from './policy_selector';
Expand Down Expand Up @@ -65,7 +66,7 @@ function getFleetLink({
}
: {
label: GET_STARTED_WITH_FLEET_LABEL,
href: `${basePath}/app/integrations#/detail/apm-0.4.0/overview`,
href: `${basePath}/app/integrations#/detail/apm-${SUPPORTED_APM_PACKAGE_VERSION}/overview`,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { i18n } from '@kbn/i18n';
import { HttpStart } from 'kibana/public';
import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { SUPPORTED_APM_PACKAGE_VERSION } from '../../../common/fleet';
import { APIReturnType } from '../../services/rest/createCallApmApi';

interface Props {
Expand Down Expand Up @@ -98,7 +99,7 @@ function TutorialFleetInstructions({ http, basePath, isDarkTheme }: Props) {
<EuiButton
iconType="analyzeEvent"
color="success"
href={`${basePath}/app/integrations#/detail/apm-0.4.0/overview`}
href={`${basePath}/app/integrations#/detail/apm-${SUPPORTED_APM_PACKAGE_VERSION}/overview`}
>
{i18n.translate(
'xpack.apm.tutorial.apmServer.fleet.apmIntegration.button',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export const exampleResult = {
source: 'custom',
},
],
schemaFields: { cats: 'text', dogs: 'text' },
schemaFields: {},
};

export const mostRecentIndexJob = {
Expand Down
Loading

0 comments on commit 132ec86

Please sign in to comment.