Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Apr 23, 2020
2 parents c4877a0 + bb89b6a commit 8ce67d2
Show file tree
Hide file tree
Showing 286 changed files with 6,704 additions and 3,957 deletions.
3 changes: 3 additions & 0 deletions .github/paths-labeller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- "Feature:ExpressionLanguage":
- "src/plugins/expressions/**/*.*"
- "src/plugins/bfetch/**/*.*"
- "Team:apm"
- "x-pack/plugins/apm/**/*.*"
- "x-pack/legacy/plugins/apm/**/*.*"
- "Team:uptime":
- "x-pack/plugins/uptime/**/*.*"
- "x-pack/legacy/plugins/uptime/**/*.*"
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"visTypeMarkdown": "src/plugins/vis_type_markdown",
"visTypeMetric": "src/plugins/vis_type_metric",
"visTypeTable": "src/plugins/vis_type_table",
"visTypeTagCloud": "src/legacy/core_plugins/vis_type_tagcloud",
"visTypeTagCloud": "src/plugins/vis_type_tagcloud",
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",
"visTypeVislib": "src/legacy/core_plugins/vis_type_vislib",
Expand Down
6 changes: 3 additions & 3 deletions docs/setup/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Some example translations are shown here:
**Environment Variable**:: **Kibana Setting**
`SERVER_NAME`:: `server.name`
`KIBANA_DEFAULTAPPID`:: `kibana.defaultAppId`
`XPACK_MONITORING_ENABLED`:: `xpack.monitoring.enabled`
`MONITORING_ENABLED`:: `monitoring.enabled`

In general, any setting listed in <<settings>> can be
configured with this technique.
Expand Down Expand Up @@ -125,9 +125,9 @@ images:
`server.name`:: `kibana`
`server.host`:: `"0"`
`elasticsearch.hosts`:: `http://elasticsearch:9200`
`xpack.monitoring.ui.container.elasticsearch.enabled`:: `true`
`monitoring.ui.container.elasticsearch.enabled`:: `true`

NOTE: The setting `xpack.monitoring.ui.container.elasticsearch.enabled` is not
NOTE: The setting `monitoring.ui.container.elasticsearch.enabled` is not
defined in the `-oss` image.

These settings are defined in the default `kibana.yml`. They can be overridden
Expand Down
4 changes: 2 additions & 2 deletions docs/user/monitoring/cluster-alerts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ To receive email notifications for the Cluster Alerts:
. Configure an email account as described in
{ref}/actions-email.html#configuring-email[Configuring email accounts].
. Configure the
`xpack.monitoring.cluster_alerts.email_notifications.email_address` setting in
`monitoring.cluster_alerts.email_notifications.email_address` setting in
`kibana.yml` with your email address.
+
--
TIP: If you have separate production and monitoring clusters and separate {kib}
instances for those clusters, you must put the
`xpack.monitoring.cluster_alerts.email_notifications.email_address` setting in
`monitoring.cluster_alerts.email_notifications.email_address` setting in
the {kib} instance that is associated with the production cluster.

--
Expand Down
2 changes: 1 addition & 1 deletion docs/user/monitoring/elasticsearch-details.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ image::user/monitoring/images/monitoring-elasticsearch-logs.jpg["Recent {es} log

TIP: By default, up to 10 log entries are shown. You can show up to 50 log
entries by changing the
<<monitoring-ui-settings,`xpack.monitoring.elasticsearch.logFetchCount` setting>>.
<<monitoring-ui-settings,`monitoring.ui.elasticsearch.logFetchCount` setting>>.
4 changes: 2 additions & 2 deletions docs/user/monitoring/monitoring-kibana.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ For more information, see {ref}/monitoring-settings.html[Monitoring settings in
and {ref}/cluster-update-settings.html[Cluster update settings].
--

. Verify that `xpack.monitoring.enabled` and
`xpack.monitoring.kibana.collection.enabled` are set to `true` in the
. Verify that `monitoring.enabled` and
`monitoring.kibana.collection.enabled` are set to `true` in the
`kibana.yml` file. These are the default values. For
more information, see <<monitoring-settings-kb,Monitoring settings in {kib}>>.

Expand Down
4 changes: 2 additions & 2 deletions docs/user/monitoring/monitoring-metricbeat.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Add the following setting in the {kib} configuration file (`kibana.yml`):

[source,yaml]
----------------------------------
xpack.monitoring.kibana.collection.enabled: false
monitoring.kibana.collection.enabled: false
----------------------------------

Leave the `xpack.monitoring.enabled` set to its default value (`true`).
Leave the `monitoring.enabled` set to its default value (`true`).
// end::disable-kibana-collection[]
For more information, see
<<monitoring-settings-kb,Monitoring settings in {kib}>>.
Expand Down
2 changes: 1 addition & 1 deletion docs/user/monitoring/monitoring-troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The *Stack Monitoring* page in {kib} is empty.
. Confirm that {kib} is seeking monitoring data from the appropriate {es} URL.
By default, data is retrieved from the cluster specified in the
`elasticsearch.hosts` setting in the `kibana.yml` file. If you want to retrieve it
from a different monitoring cluster, set `xpack.monitoring.elasticsearch.hosts`.
from a different monitoring cluster, set `monitoring.ui.elasticsearch.hosts`.
See <<monitoring-settings-kb>>.

. Confirm that there is monitoring data available at that URL. It is stored in
Expand Down
8 changes: 4 additions & 4 deletions docs/user/monitoring/viewing-metrics.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ cluster and view them all through the same instance of {kib}.

By default, data is retrieved from the cluster specified in the
`elasticsearch.hosts` value in the `kibana.yml` file. If you want to retrieve it
from a different cluster, set `xpack.monitoring.elasticsearch.hosts`.
from a different cluster, set `monitoring.ui.elasticsearch.hosts`.

To learn more about typical monitoring architectures,
see {ref}/how-monitoring-works.html[How monitoring works] and
{ref}/monitoring-production.html[Monitoring in a production environment].
--

. Verify that `xpack.monitoring.ui.enabled` is set to `true`, which is the
. Verify that `monitoring.ui.enabled` is set to `true`, which is the
default value, in the `kibana.yml` file. For more information, see
<<monitoring-settings-kb>>.

Expand All @@ -43,8 +43,8 @@ must provide a user ID and password so {kib} can retrieve the data.
.. Create a user that has the `monitoring_user`
{ref}/built-in-roles.html[built-in role] on the monitoring cluster.

.. Add the `xpack.monitoring.elasticsearch.username` and
`xpack.monitoring.elasticsearch.password` settings in the `kibana.yml` file.
.. Add the `monitoring.ui.elasticsearch.username` and
`monitoring.ui.elasticsearch.password` settings in the `kibana.yml` file.
If these settings are omitted, {kib} uses the `elasticsearch.username` and
`elasticsearch.password` setting values. For more
information, see {kibana-ref}/using-kibana-with-security.html[Configuring security in {kib}].
Expand Down
4 changes: 2 additions & 2 deletions docs/user/security/securing-communications/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@ verification. For more information about this setting, see <<settings,{kib} conf
--

If the Elastic {monitor-features} are enabled and you have set up a separate {es} monitoring cluster, you can also configure {kib} to
connect to the monitoring cluster via HTTPS. The steps are the same, but each setting is prefixed by `xpack.monitoring.`. For
example, `xpack.monitoring.elasticsearch.hosts`, `xpack.monitoring.elasticsearch.ssl.truststore.path`, etc.
connect to the monitoring cluster via HTTPS. The steps are the same, but each setting is prefixed by `monitoring.`. For
example, `monitoring.ui.elasticsearch.hosts`, `monitoring.ui.elasticsearch.ssl.truststore.path`, etc.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ kibana_vars=(
map.tilemap.options.minZoom
map.tilemap.options.subdomains
map.tilemap.url
monitoring.cluster_alerts.email_notifications.email_address
monitoring.enabled
monitoring.kibana.collection.enabled
monitoring.kibana.collection.interval
monitoring.ui.container.elasticsearch.enabled
monitoring.ui.container.logstash.enabled
monitoring.ui.elasticsearch.password
monitoring.ui.elasticsearch.pingTimeout
monitoring.ui.elasticsearch.hosts
monitoring.ui.elasticsearch.username
monitoring.ui.elasticsearch.logFetchCount
monitoring.ui.elasticsearch.ssl.certificateAuthorities
monitoring.ui.elasticsearch.ssl.verificationMode
monitoring.ui.enabled
monitoring.ui.max_bucket_size
monitoring.ui.min_interval_seconds
newsfeed.enabled
ops.interval
path.data
Expand Down Expand Up @@ -160,25 +176,6 @@ kibana_vars=(
xpack.infra.sources.default.metricAlias
xpack.license_management.enabled
xpack.ml.enabled
xpack.monitoring.cluster_alerts.email_notifications.email_address
xpack.monitoring.elasticsearch.password
xpack.monitoring.elasticsearch.pingTimeout
xpack.monitoring.elasticsearch.hosts
xpack.monitoring.elasticsearch.username
xpack.monitoring.elasticsearch.logFetchCount
xpack.monitoring.elasticsearch.ssl.certificateAuthorities
xpack.monitoring.elasticsearch.ssl.verificationMode
xpack.monitoring.enabled
xpack.monitoring.kibana.collection.enabled
xpack.monitoring.kibana.collection.interval
xpack.monitoring.max_bucket_size
xpack.monitoring.min_interval_seconds
xpack.monitoring.node_resolver
xpack.monitoring.report_stats
xpack.monitoring.elasticsearch.pingTimeout
xpack.monitoring.ui.container.elasticsearch.enabled
xpack.monitoring.ui.container.logstash.enabled
xpack.monitoring.ui.enabled
xpack.reporting.capture.browser.autoDownload
xpack.reporting.capture.browser.chromium.disableSandbox
xpack.reporting.capture.browser.chromium.inspect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ function generator({ imageFlavor }) {
#
# ** THIS IS AN AUTO-GENERATED FILE **
#
# Default Kibana configuration for docker target
server.name: kibana
server.host: "0"
elasticsearch.hosts: [ "http://elasticsearch:9200" ]
${!imageFlavor ? 'xpack.monitoring.ui.container.elasticsearch.enabled: true' : ''}
${!imageFlavor ? 'monitoring.ui.container.elasticsearch.enabled: true' : ''}
`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ import expect from '@kbn/expect';
import _ from 'lodash';
import d3 from 'd3';

import { TagCloud } from '../tag_cloud';
import { fromNode, delay } from 'bluebird';
import { ImageComparator } from 'test_utils/image_comparator';
import simpleloadPng from './simpleload.png';

// Replace with mock when converting to jest tests
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { seedColors } from '../../../../../../plugins/charts/public/services/colors/seed_colors';
// Will be replaced with new path when tests are moved
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { TagCloud } from '../../../../../../plugins/vis_type_tagcloud/public/components/tag_cloud';

describe('tag cloud tests', function() {
const minValue = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import expect from '@kbn/expect';
import ngMock from 'ng_mock';
import { ImageComparator } from 'test_utils/image_comparator';
import { createTagCloudVisualization } from '../tag_cloud_visualization';
import basicdrawPng from './basicdraw.png';
import afterresizePng from './afterresize.png';
import afterparamChange from './afterparamchange.png';
Expand All @@ -32,7 +31,14 @@ import { ExprVis } from '../../../../../../plugins/visualizations/public/express
import { seedColors } from '../../../../../../plugins/charts/public/services/colors/seed_colors';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { BaseVisType } from '../../../../../../plugins/visualizations/public/vis_types/base_vis_type';
import { createTagCloudVisTypeDefinition } from '../../tag_cloud_type';
// Will be replaced with new path when tests are moved
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { createTagCloudVisTypeDefinition } from '../../../../../../plugins/vis_type_tagcloud/public/tag_cloud_type';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { createTagCloudVisualization } from '../../../../../../plugins/vis_type_tagcloud/public/components/tag_cloud_visualization';
import { npStart } from 'ui/new_platform';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { setFormatService } from '../../../../../../plugins/vis_type_tagcloud/public/services';

const THRESHOLD = 0.65;
const PIXEL_DIFF = 64;
Expand Down Expand Up @@ -66,6 +72,8 @@ describe('TagCloudVisualizationTest', function() {
},
});

before(() => setFormatService(npStart.plugins.data.fieldFormats));

beforeEach(ngMock.module('kibana'));

describe('TagCloudVisualization - basics', function() {
Expand Down
44 changes: 0 additions & 44 deletions src/legacy/core_plugins/vis_type_tagcloud/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/core_plugins/vis_type_tagcloud/package.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export const createFilterFilters = (aggConfig: IBucketAggConfig, key: string) =>
const indexPattern = aggConfig.getIndexPattern();

if (filter && indexPattern && indexPattern.id) {
return buildQueryFilter(filter.query, indexPattern.id, key);
return buildQueryFilter(filter, indexPattern.id, key);
}
};
2 changes: 1 addition & 1 deletion src/plugins/data/public/search/aggs/buckets/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const getFiltersBucketAgg = ({
(typeof filter.input.query === 'string'
? filter.input.query
: toAngularJSON(filter.input.query));
filters[label] = { query };
filters[label] = query;
},
{}
);
Expand Down
20 changes: 0 additions & 20 deletions src/plugins/data/public/search/search_source/search_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,26 +447,6 @@ export class SearchSource {
delete searchRequest.highlightAll;
}

const translateToQuery = (filter: Filter) => filter && (filter.query || filter);

// re-write filters within filter aggregations
(function recurse(aggBranch) {
if (!aggBranch) return;
Object.keys(aggBranch).forEach(function(id) {
const agg = aggBranch[id];

if (agg.filters) {
// translate filters aggregations
const { filters: aggFilters } = agg.filters;
Object.keys(aggFilters).forEach(filterId => {
aggFilters[filterId] = translateToQuery(aggFilters[filterId]);
});
}

recurse(agg.aggs || agg.aggregations);
});
})(body.aggs || body.aggregations);

return searchRequest;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { shouldReadFieldFromDocValues } from './should_read_field_from_doc_values';

describe('shouldReadFieldFromDocValues', () => {
test('should read field from doc values for aggregatable "number" field', async () => {
expect(shouldReadFieldFromDocValues(true, 'number')).toBe(true);
});

test('should not read field from doc values for non-aggregatable "number "field', async () => {
expect(shouldReadFieldFromDocValues(false, 'number')).toBe(false);
});

test('should not read field from doc values for "text" field', async () => {
expect(shouldReadFieldFromDocValues(true, 'text')).toBe(false);
});

test('should not read field from doc values for "geo_shape" field', async () => {
expect(shouldReadFieldFromDocValues(true, 'geo_shape')).toBe(false);
});

test('should not read field from doc values for underscore field', async () => {
expect(shouldReadFieldFromDocValues(true, '_source')).toBe(false);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
*/

export function shouldReadFieldFromDocValues(aggregatable: boolean, esType: string) {
return aggregatable && esType !== 'text' && !esType.startsWith('_');
return aggregatable && !['text', 'geo_shape'].includes(esType) && !esType.startsWith('_');
}
2 changes: 1 addition & 1 deletion src/plugins/home/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"server": true,
"ui": true,
"requiredPlugins": ["data", "kibanaLegacy"],
"optionalPlugins": ["usage_collection", "telemetry"]
"optionalPlugins": ["usageCollection", "telemetry"]
}
Loading

0 comments on commit 8ce67d2

Please sign in to comment.