Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into implement/sav…
Browse files Browse the repository at this point in the history
…ed-objects/experimental-filter
  • Loading branch information
spalger committed Apr 4, 2018
2 parents 9ceb0e2 + ace7f34 commit 1f69d8d
Show file tree
Hide file tree
Showing 19 changed files with 82 additions and 33 deletions.
2 changes: 1 addition & 1 deletion config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
#elasticsearch.customHeaders: {}

# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
#elasticsearch.shardTimeout: 0
#elasticsearch.shardTimeout: 30000

# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying.
#elasticsearch.startupTimeout: 5000
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/known-plugins.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ This list of plugins is not guaranteed to work on your version of Kibana. Instea
Use it to create, edit and embed visualizations, and also to search inside an embedded dashboard.

* https://github.com/sw-jung/kibana_markdown_doc_view[Markdown Doc View] (sw-jung) - A plugin for custom doc view using markdown+handlebars template.

* https://github.com/datasweet-fr/kibana-datasweet-formula[Datasweet Formula] (datasweet) - enables calculated metric on any standard Kibana visualization.

NOTE: If you want your plugin to be added to this page, open a {repo}tree/{branch}/docs/plugins/known-plugins.asciidoc[pull request].
6 changes: 3 additions & 3 deletions docs/setup/install/deb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ The Debian package for Kibana v{version} can be downloaded from the website and
["source","sh",subs="attributes"]
--------------------------------------------
wget https://artifacts.elastic.co/downloads/kibana/kibana-{version}-amd64.deb
sha1sum kibana-{version}-amd64.deb <1>
shasum -a 512 kibana-{version}-amd64.deb <1>
sudo dpkg -i kibana-{version}-amd64.deb
--------------------------------------------
<1> Compare the SHA produced by `sha1sum` or `shasum` with the
https://artifacts.elastic.co/downloads/kibana/kibana-{version}-amd64.deb.sha1[published SHA].
<1> Compare the SHA produced by `shasum` with the
https://artifacts.elastic.co/downloads/kibana/kibana-{version}-amd64.deb.sha512[published SHA].

endif::[]

Expand Down
6 changes: 3 additions & 3 deletions docs/setup/install/rpm.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ The RPM for Kibana v{version} can be downloaded from the website and installed a
["source","sh",subs="attributes"]
--------------------------------------------
wget https://artifacts.elastic.co/downloads/kibana/kibana-{version}-x86_64.rpm
sha1sum kibana-{version}-x86_64.rpm <1>
shasum -a 512 kibana-{version}-x86_64.rpm <1>
sudo rpm --install kibana-{version}-x86_64.rpm
--------------------------------------------
<1> Compare the SHA produced by `sha1sum` or `shasum` with the
https://artifacts.elastic.co/downloads/kibana/kibana-{version}-x86_64.rpm.sha1[published SHA].
<1> Compare the SHA produced by `shasum` with the
https://artifacts.elastic.co/downloads/kibana/kibana-{version}-x86_64.rpm.sha512[published SHA].

endif::[]

Expand Down
12 changes: 6 additions & 6 deletions docs/setup/install/targz.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ The Linux archive for Kibana v{version} can be downloaded and installed as follo
["source","sh",subs="attributes"]
--------------------------------------------
wget https://artifacts.elastic.co/downloads/kibana/kibana-{version}-linux-x86_64.tar.gz
sha1sum kibana-{version}-linux-x86_64.tar.gz <1>
shasum -a 512 kibana-{version}-linux-x86_64.tar.gz <1>
tar -xzf kibana-{version}-linux-x86_64.tar.gz
cd kibana-{version}-linux-x86_64/ <2>
--------------------------------------------
<1> Compare the SHA produced by `sha1sum` or `shasum` with the
https://artifacts.elastic.co/downloads/kibana/kibana-{version}-linux-x86_64.tar.gz.sha1[published SHA].
<1> Compare the SHA produced by or `shasum` with the
https://artifacts.elastic.co/downloads/kibana/kibana-{version}-linux-x86_64.tar.gz.sha512[published SHA].
<2> This directory is known as `$KIBANA_HOME`.

endif::[]
Expand All @@ -53,12 +53,12 @@ The Darwin archive for Kibana v{version} can be downloaded and installed as foll
["source","sh",subs="attributes"]
--------------------------------------------
curl -O https://artifacts.elastic.co/downloads/kibana/kibana-{version}-darwin-x86_64.tar.gz
shasum kibana-{version}-darwin-x86_64.tar.gz <1>
shasum -a 512 kibana-{version}-darwin-x86_64.tar.gz <1>
tar -xzf kibana-{version}-darwin-x86_64.tar.gz
cd kibana-{version}-darwin-x86_64/ <2>
--------------------------------------------
<1> Compare the SHA produced by `sha1sum` or `shasum` with the
https://artifacts.elastic.co/downloads/kibana/kibana-{version}-darwin-x86_64.tar.gz.sha1[published SHA].
<1> Compare the SHA produced by or `shasum` with the
https://artifacts.elastic.co/downloads/kibana/kibana-{version}-darwin-x86_64.tar.gz.sha512[published SHA].
<2> This directory is known as `$KIBANA_HOME`.

endif::[]
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ to this Kibana instance.
To send *no* client-side headers, set this value to [] (an empty list).
`elasticsearch.requestTimeout:`:: *Default: 30000* Time in milliseconds to wait for responses from the back end or
Elasticsearch. This value must be a positive integer.
`elasticsearch.shardTimeout:`:: *Default: 0* Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
`elasticsearch.shardTimeout:`:: *Default: 30000* Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
`elasticsearch.ssl.certificate:` and `elasticsearch.ssl.key:`:: Optional settings that provide the paths to the PEM-format SSL
certificate and key files. These files are used to verify the identity of Kibana to Elasticsearch and are required when `xpack.ssl.verification_mode` in Elasticsearch is set to either `certificate` or `full`.
`elasticsearch.ssl.certificateAuthorities:`:: Optional setting that enables you to specify a list of paths to the PEM file for the certificate
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"dependencies": {
"@elastic/eui": "^0.0.37",
"@elastic/filesaver": "1.1.2",
"@elastic/numeral": "2.3.1",
"@elastic/numeral": "2.3.2",
"@elastic/ui-ace": "0.2.3",
"@kbn/babel-preset": "link:packages/kbn-babel-preset",
"@kbn/datemath": "link:packages/kbn-datemath",
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function (kibana) {
preserveHost: boolean().default(true),
username: string(),
password: string(),
shardTimeout: number().default(0),
shardTimeout: number().default(30000),
requestTimeout: number().default(30000),
requestHeadersWhitelist: array().items().single().default(DEFAULT_REQUEST_HEADERS),
customHeaders: object().default({}),
Expand Down
23 changes: 22 additions & 1 deletion src/core_plugins/kibana/public/dashboard/grid/dashboard_grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import classNames from 'classnames';
import { PanelUtils } from '../panel/panel_utils';
import { DashboardViewMode } from '../dashboard_view_mode';
import { DashboardPanel } from '../panel';
import { toastNotifications } from 'ui/notify';
import {
DashboardConstants,
DASHBOARD_GRID_COLUMN_COUNT,
DASHBOARD_GRID_HEIGHT,
} from '../dashboard_constants';
Expand Down Expand Up @@ -87,10 +89,25 @@ export class DashboardGrid extends React.Component {
// A mapping of panelIndexes to grid items so we can set the zIndex appropriately on the last focused
// item.
this.gridItems = {};

let isLayoutInvalid = false;
let layout;
try {
layout = this.buildLayoutFromPanels();
} catch (error) {
isLayoutInvalid = true;
toastNotifications.addDanger({
title: 'Unable to load dashboard.',
text: error.message,
});
window.location = `#${DashboardConstants.LANDING_PAGE_PATH}`;
}
this.state = {
focusedPanelIndex: undefined,
layout: this.buildLayoutFromPanels()
layout,
isLayoutInvalid,
};

// A mapping of panel type to embeddable handlers. Because this function reaches out of react and into angular,
// if done in the render method, it appears to be triggering a scope.apply, which appears to be trigging a setState
// call inside TSVB visualizations. Moving the function out of render appears to fix the issue. See
Expand Down Expand Up @@ -200,6 +217,10 @@ export class DashboardGrid extends React.Component {
}

render() {
if (this.state.isLayoutInvalid) {
return null;
}

const { dashboardViewMode, maximizedPanelId, useMargins } = this.props;
const isViewMode = dashboardViewMode === DashboardViewMode.VIEW;
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import { DashboardGrid } from './dashboard_grid';

jest.mock('ui/chrome', () => ({ getKibanaVersion: () => '6.0.0' }), { virtual: true });

jest.mock('ui/notify',
() => ({
toastNotifications: {
addDanger: () => {},
}
}), { virtual: true });

function getProps(props = {}) {
const defaultTestProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ import { updatePanels } from '../actions';

jest.mock('ui/chrome', () => ({ getKibanaVersion: () => '6.3.0' }), { virtual: true });

jest.mock('ui/notify',
() => ({
toastNotifications: {
addDanger: () => {},
}
}), { virtual: true });

function getProps(props = {}) {
const defaultTestProps = {
hidden: false,
Expand Down
13 changes: 13 additions & 0 deletions src/core_plugins/kibana/public/dashboard/panel/panel_utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from '../dashboard_constants';
import chrome from 'ui/chrome';

Expand All @@ -8,6 +9,12 @@ export class PanelUtils {

// 6.1 switched from gridster to react grid. React grid uses different variables for tracking layout
static convertPanelDataPre_6_1(panel) { // eslint-disable-line camelcase
['col', 'row'].forEach(key => {
if (!_.has(panel, key)) {
throw new Error(`Unable to migrate panel data for "6.1.0" backwards compatibility, panel does not contain expected field: ${key}`);
}
});

panel.gridData = {
x: panel.col - 1,
y: panel.row - 1,
Expand All @@ -30,6 +37,12 @@ export class PanelUtils {
// 2) increase rows from 12 to 48
// Need to scale pre 6.3 panels so they maintain the same layout
static convertPanelDataPre_6_3(panel) { // eslint-disable-line camelcase
['w', 'x', 'h', 'y'].forEach(key => {
if (!_.has(panel.gridData, key)) {
throw new Error(`Unable to migrate panel data for "6.3.0" backwards compatibility, panel does not contain expected field: ${key}`);
}
});

panel.gridData.w = panel.gridData.w * PANEL_WIDTH_SCALE_FACTOR;
panel.gridData.x = panel.gridData.x * PANEL_WIDTH_SCALE_FACTOR;
panel.gridData.h = panel.gridData.h * PANEL_HEIGHT_SCALE_FACTOR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,11 @@ function discoverController(
// fetch data when filters fire fetch event
$scope.$listen(queryFilter, 'fetch', $scope.fetch);

timefilter.enableAutoRefreshSelector();
$scope.$watch('opts.timefield', function (timefield) {
if (!!timefield) {
timefilter.enableAutoRefreshSelector();
timefilter.enableTimeRangeSelector();
} else {
timefilter.disableAutoRefreshSelector();
timefilter.disableTimeRangeSelector();
}
});
Expand Down
3 changes: 1 addition & 2 deletions src/core_plugins/kibana/public/visualize/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,8 @@ function VisEditor($scope, $route, timefilter, AppState, $window, kbnUrl, courie
const showTimeFilter = Boolean((!index || index.timeFieldName) && requiresTimePicker);

if (showTimeFilter) {
timefilter.enableAutoRefreshSelector();
timefilter.enableTimeRangeSelector();
} else {
timefilter.disableAutoRefreshSelector();
timefilter.disableTimeRangeSelector();
}
});
Expand All @@ -224,6 +222,7 @@ function VisEditor($scope, $route, timefilter, AppState, $window, kbnUrl, courie
$scope.timeRange = timefilter.time;
};

timefilter.enableAutoRefreshSelector();
timefilter.on('update', updateTimeRange);

// update the searchSource when filters update
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { get, map } from 'lodash';
import handleESError from '../../../lib/handle_es_error';

export function registerValueSuggestions(server) {
Expand All @@ -11,7 +12,8 @@ export function registerValueSuggestions(server) {
const body = getBody({ field, query });
try {
const response = await callWithRequest(req, 'search', { index, body });
const suggestions = response.aggregations.suggestions.buckets.map(bucket => bucket.key);
const buckets = get(response, 'aggregations.suggestions.buckets') || [];
const suggestions = map(buckets, 'key');
reply(suggestions);
} catch (error) {
reply(handleESError(error));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable max-len */

export const NODE_CLIENT_INSTRUCTIONS = [
{
title: 'Install the APM agent',
Expand All @@ -22,10 +24,7 @@ var apm = require('elastic-apm-node').start({curlyOpen}
// Set custom APM Server URL (default: http://localhost:8200)
serverUrl: ''
{curlyClose})`.split('\n'),
textPost:
'See [the documentation]({config.docs.base_url}guide/en/apm/agent/nodejs/1.x/index.html)' +
' for advanced usage. Babel users, refer to [the documentation]' +
'({config.docs.base_url}guide/en/apm/agent/nodejs/1.x/advanced-setup.html#es-modules).',
textPost: `See [the documentation]({config.docs.base_url}guide/en/apm/agent/nodejs/1.x/index.html) for advanced usage, including how to use with [Babel/ES Modules]({config.docs.base_url}guide/en/apm/agent/nodejs/1.x/advanced-setup.html#es-modules).`,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export function requestFetchParamsToBody(
timeFilter,
kbnIndex,
sessionId,
config) {
config,
esShardTimeout) {
const indexToListMapping = {};
const timeBounds = timeFilter.getActiveBounds();
const promises = requestsFetchParams.map(function (fetchParams) {
Expand Down Expand Up @@ -74,6 +75,7 @@ export function requestFetchParamsToBody(
type: fetchParams.type,
search_type: fetchParams.search_type,
ignore_unavailable: true,
timeout: esShardTimeout,
};
if (config.get('courier:setRequestPreference') === 'sessionId') {
header.preference = sessionId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { requestFetchParamsToBody } from './request_fetch_params_to_body';

export function RequestFetchParamsToBodyProvider(Promise, timefilter, kbnIndex, sessionId, config) {
export function RequestFetchParamsToBodyProvider(Promise, timefilter, kbnIndex, sessionId, config, esShardTimeout) {
return (requestsFetchParams) => (
requestFetchParamsToBody(
requestsFetchParams,
Promise,
timefilter,
kbnIndex,
sessionId,
config)
config,
esShardTimeout)
);
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
version "1.1.2"
resolved "https://registry.yarnpkg.com/@elastic/filesaver/-/filesaver-1.1.2.tgz#1998ffb3cd89c9da4ec12a7793bfcae10e30c77a"

"@elastic/numeral@2.3.1":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@elastic/numeral/-/numeral-2.3.1.tgz#743801971d8f0c975f9a122867d0e8939d31b3eb"
"@elastic/numeral@2.3.2":
version "2.3.2"
resolved "https://registry.yarnpkg.com/@elastic/numeral/-/numeral-2.3.2.tgz#06c9ef22f18dd8c2b39ffe353868d4d0c13ea4f9"

"@elastic/ui-ace@0.2.3":
version "0.2.3"
Expand Down

0 comments on commit 1f69d8d

Please sign in to comment.