Skip to content

Commit

Permalink
Merge branch 'master' into feature-ingest-manager-global-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Apr 23, 2020
2 parents 8b64032 + 4fc1c5f commit 0051ff2
Show file tree
Hide file tree
Showing 124 changed files with 2,431 additions and 1,606 deletions.
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 All @@ -197,10 +194,14 @@ kibana_vars=(
xpack.reporting.csv.checkForFormulas
xpack.reporting.csv.escapeFormulaValues
xpack.reporting.csv.enablePanelActionDownload
xpack.reporting.csv.useByteOrderMarkEncoding
xpack.reporting.csv.maxSizeBytes
xpack.reporting.csv.scroll.duration
xpack.reporting.csv.scroll.size
xpack.reporting.capture.maxAttempts
xpack.reporting.capture.timeouts.openUrl
xpack.reporting.capture.timeouts.waitForElements
xpack.reporting.capture.timeouts.renderComplete
xpack.reporting.enabled
xpack.reporting.encryptionKey
xpack.reporting.index
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 @@ -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('_');
}
21 changes: 17 additions & 4 deletions x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { horizontalProgressPill } from './horizontal_progress_pill';
import { image } from './image';
import { lineChart } from './line_chart';
import { markdown } from './markdown';
import { metric } from './metric';
import { metricElementInitializer } from './metric';
import { pie } from './pie';
import { plot } from './plot';
import { progressGauge } from './progress_gauge';
Expand All @@ -32,7 +32,10 @@ import { verticalBarChart } from './vert_bar_chart';
import { verticalProgressBar } from './vertical_progress_bar';
import { verticalProgressPill } from './vertical_progress_pill';

export const elementSpecs = applyElementStrings([
import { SetupInitializer } from '../plugin';
import { ElementFactory } from '../../types';

const elementSpecs = [
areaChart,
bubbleChart,
debug,
Expand All @@ -44,7 +47,6 @@ export const elementSpecs = applyElementStrings([
horizontalProgressPill,
lineChart,
markdown,
metric,
pie,
plot,
progressGauge,
Expand All @@ -59,4 +61,15 @@ export const elementSpecs = applyElementStrings([
verticalBarChart,
verticalProgressBar,
verticalProgressPill,
]);
];

const initializeElementFactories = [metricElementInitializer];

export const initializeElements: SetupInitializer<ElementFactory[]> = (core, plugins) => {
const specs = [
...elementSpecs,
...initializeElementFactories.map(factory => factory(core, plugins)),
];

return applyElementStrings(specs);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@

import { openSans } from '../../../common/lib/fonts';
import header from './header.png';
import { getAdvancedSettings } from '../../../public/lib/kibana_advanced_settings';

import { ElementFactory } from '../../../types';
export const metric: ElementFactory = () => ({
name: 'metric',
displayName: 'Metric',
tags: ['text'],
help: 'A number with a label',
width: 200,
height: 100,
image: header,
expression: `filters
| demodata
| math "unique(country)"
| metric "Countries"
metricFont={font size=48 family="${openSans.value}" color="#000000" align="center" lHeight=48}
labelFont={font size=14 family="${openSans.value}" color="#000000" align="center"}
metricFormat="${getAdvancedSettings().get('format:number:defaultPattern')}"
| render`,
});
import { SetupInitializer } from '../../plugin';

export const metricElementInitializer: SetupInitializer<ElementFactory> = (core, setup) => {
return () => ({
name: 'metric',
displayName: 'Metric',
tags: ['text'],
help: 'A number with a label',
width: 200,
height: 100,
image: header,
expression: `filters
| demodata
| math "unique(country)"
| metric "Countries"
metricFont={font size=48 family="${openSans.value}" color="#000000" align="center" lHeight=48}
labelFont={font size=14 family="${openSans.value}" color="#000000" align="center"}
metricFormat="${core.uiSettings.get('format:number:defaultPattern')}"
| render`,
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common';
import { Render } from '../../../types';
import { getFunctionHelp } from '../../../i18n';

interface Arguments {
export interface Arguments {
column: string;
compact: boolean;
filterGroup: string;
Expand Down
Loading

0 comments on commit 0051ff2

Please sign in to comment.