Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into ts_vector_sty…
Browse files Browse the repository at this point in the history
…le_properties
  • Loading branch information
nreese committed Aug 6, 2020
2 parents 41bde06 + bbfc492 commit c5f4ab0
Show file tree
Hide file tree
Showing 74 changed files with 1,076 additions and 468 deletions.
13 changes: 13 additions & 0 deletions .ci/pipeline-library/src/test/prChanges.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,17 @@ class PrChangesTest extends KibanaBasePipelineTest {

assertFalse(prChanges.areChangesSkippable())
}

@Test
void 'areChangesSkippable() with plugin readme changes'() {
props([
githubPrs: [
getChanges: { [
[filename: 'src/plugins/foo/README.asciidoc'],
] },
],
])

assertFalse(prChanges.areChangesSkippable())
}
}
6 changes: 0 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ module.exports = {
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/plugins/lens/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/plugins/ml/**/*.{js,mjs,ts,tsx}'],
rules: {
Expand Down
4 changes: 2 additions & 2 deletions docs/drilldowns/explore-underlying-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ applies the filters and time range created by the events that triggered the acti
[role="screenshot"]
image::images/explore_data_in_chart.png[Explore underlying data from chart]

You can disable this action by adding the following line to your `kibana.yml` config.
To enable this action add the following line to your `kibana.yml` config.

["source","yml"]
-----------
xpack.discoverEnhanced.actions.exploreDataInChart.enabled: false
xpack.discoverEnhanced.actions.exploreDataInChart.enabled: true
-----------
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/user/monitoring/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include::xpack-monitoring.asciidoc[]
include::beats-details.asciidoc[leveloffset=+1]
include::cluster-alerts.asciidoc[leveloffset=+1]
include::elasticsearch-details.asciidoc[leveloffset=+1]
include::kibana-alerts.asciidoc[leveloffset=+1]
include::kibana-details.asciidoc[leveloffset=+1]
include::logstash-details.asciidoc[leveloffset=+1]
include::monitoring-troubleshooting.asciidoc[leveloffset=+1]
36 changes: 36 additions & 0 deletions docs/user/monitoring/kibana-alerts.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[role="xpack"]
[[kibana-alerts]]
= {kib} Alerts

The {stack} {monitor-features} provide
<<alerting-getting-started,{kib} alerts>> out-of-the box to notify you of
potential issues in the {stack}. These alerts are preconfigured based on the
best practices recommended by Elastic. However, you can tailor them to meet your
specific needs.

When you open *{stack-monitor-app}*, the preconfigured {kib} alerts are
created automatically. If you collect monitoring data from multiple clusters,
these alerts can search, detect, and notify on various conditions across the
clusters. The alerts are visible alongside your existing {watcher} cluster
alerts. You can view details about the alerts that are active and view health
and performance data for {es}, {ls}, and Beats in real time, as well as
analyze past performance. You can also modify active alerts.

[role="screenshot"]
image::user/monitoring/images/monitoring-kibana-alerts.png["Kibana alerts in the Stack Monitoring app"]

To review and modify all the available alerts, use
<<managing-alerts-and-actions,*{alerts-ui}*>> in *{stack-manage-app}*.

[discrete]
[[kibana-alerts-cpu-threshold]]
== CPU threshold

This alert is triggered when a node runs a consistently high CPU load. By
default, the trigger condition is set at 85% or more averaged over the last 5
minutes. The alert is grouped across all the nodes of the cluster by running
checks on a schedule time of 1 minute with a re-notify internal of 1 day.

NOTE: Some action types are subscription features, while others are free.
For a comparison of the Elastic subscription levels, see the alerting section of
the {subscriptions}[Subscriptions page].
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,20 @@ export const InfoComponent = () => {
<>
<FormattedMessage
id="visualize.experimentalVisInfoText"
defaultMessage="This visualization is marked as experimental. Have feedback? Please create an issue in"
/>{' '}
<EuiLink external href="https://github.com/elastic/kibana/issues/new/choose" target="_blank">
GitHub
</EuiLink>
{'.'}
defaultMessage="This visualization is experimental and is not subject to the support SLA of official GA features.
For feedback, please create an issue in {githubLink}."
values={{
githubLink: (
<EuiLink
external
href="https://github.com/elastic/kibana/issues/new/choose"
target="_blank"
>
GitHub
</EuiLink>
),
}}
/>
</>
);

Expand Down
2 changes: 2 additions & 0 deletions vars/prChanges.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def getNotSkippablePaths() {
return [
// this file is auto-generated and changes to it need to be validated with CI
/^docs\/developer\/architecture\/code-exploration.asciidoc$/,
// don't skip CI on prs with changes to plugin readme files (?i) is for case-insensitive matching
/(?i)\/plugins\/[^\/]+\/readme\.(md|asciidoc)$/,
]
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/discover_enhanced/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { PluginConfigDescriptor } from '../../../../src/core/server';
export const configSchema = schema.object({
actions: schema.object({
exploreDataInChart: schema.object({
enabled: schema.boolean({ defaultValue: true }),
enabled: schema.boolean({ defaultValue: false }),
}),
}),
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { omit } from 'lodash';
import { mapToUrlState } from './with_metrics_explorer_options_url_state';

describe('WithMetricsExplorerOptionsUrlState', () => {
describe('mapToUrlState', () => {
it('loads a valid URL state', () => {
expect(mapToUrlState(validState)).toEqual(validState);
});
it('discards invalid properties and loads valid properties into the URL', () => {
expect(mapToUrlState(invalidState)).toEqual(omit(invalidState, 'options'));
});
});
});

const validState = {
chartOptions: {
stack: false,
type: 'line',
yAxisMode: 'fromZero',
},
options: {
aggregation: 'avg',
filterQuery: '',
groupBy: ['host.hostname'],
metrics: [
{
aggregation: 'avg',
color: 'color0',
field: 'system.cpu.user.pct',
},
{
aggregation: 'avg',
color: 'color1',
field: 'system.load.1',
},
],
source: 'url',
},
timerange: {
from: 'now-1h',
interval: '>=10s',
to: 'now',
},
};

const invalidState = {
chartOptions: {
stack: false,
type: 'line',
yAxisMode: 'fromZero',
},
options: {
aggregation: 'avg',
filterQuery: '',
groupBy: ['host.hostname'],
metrics: 'this is the wrong data type',
source: 'url',
},
timerange: {
from: 'now-1h',
interval: '>=10s',
to: 'now',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
*/

import { set } from '@elastic/safer-lodash-set';
import { values } from 'lodash';
import React, { useContext, useMemo } from 'react';
import * as t from 'io-ts';
import { ThrowReporter } from 'io-ts/lib/ThrowReporter';
import { MetricsExplorerColor } from '../../../common/color_palette';
import { UrlStateContainer } from '../../utils/url_state';
import {
MetricsExplorerOptions,
MetricsExplorerOptionsContainer,
MetricsExplorerTimeOptions,
MetricsExplorerYAxisMode,
MetricsExplorerChartType,
MetricsExplorerChartOptions,
metricExplorerOptionsRT,
metricsExplorerChartOptionsRT,
metricsExplorerTimeOptionsRT,
} from '../../pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options';

interface MetricsExplorerUrlState {
Expand Down Expand Up @@ -74,36 +72,7 @@ export const WithMetricsExplorerOptionsUrlState = () => {
};

function isMetricExplorerOptions(subject: any): subject is MetricsExplorerOptions {
const MetricRequired = t.type({
aggregation: t.string,
});

const MetricOptional = t.partial({
field: t.string,
rate: t.boolean,
color: t.keyof(
Object.fromEntries(values(MetricsExplorerColor).map((c) => [c, null])) as Record<string, null>
),
label: t.string,
});

const Metric = t.intersection([MetricRequired, MetricOptional]);

const OptionsRequired = t.type({
aggregation: t.string,
metrics: t.array(Metric),
});

const OptionsOptional = t.partial({
limit: t.number,
groupBy: t.string,
filterQuery: t.string,
source: t.string,
});

const Options = t.intersection([OptionsRequired, OptionsOptional]);

const result = Options.decode(subject);
const result = metricExplorerOptionsRT.decode(subject);

try {
ThrowReporter.report(result);
Expand All @@ -114,22 +83,7 @@ function isMetricExplorerOptions(subject: any): subject is MetricsExplorerOption
}

function isMetricExplorerChartOptions(subject: any): subject is MetricsExplorerChartOptions {
const ChartOptions = t.type({
yAxisMode: t.keyof(
Object.fromEntries(values(MetricsExplorerYAxisMode).map((v) => [v, null])) as Record<
string,
null
>
),
type: t.keyof(
Object.fromEntries(values(MetricsExplorerChartType).map((v) => [v, null])) as Record<
string,
null
>
),
stack: t.boolean,
});
const result = ChartOptions.decode(subject);
const result = metricsExplorerChartOptionsRT.decode(subject);

try {
ThrowReporter.report(result);
Expand All @@ -140,12 +94,7 @@ function isMetricExplorerChartOptions(subject: any): subject is MetricsExplorerC
}

function isMetricExplorerTimeOption(subject: any): subject is MetricsExplorerTimeOptions {
const TimeRange = t.type({
from: t.string,
to: t.string,
interval: t.string,
});
const result = TimeRange.decode(subject);
const result = metricsExplorerTimeOptionsRT.decode(subject);
try {
ThrowReporter.report(result);
return true;
Expand All @@ -154,7 +103,7 @@ function isMetricExplorerTimeOption(subject: any): subject is MetricsExplorerTim
}
}

const mapToUrlState = (value: any): MetricsExplorerUrlState | undefined => {
export const mapToUrlState = (value: any): MetricsExplorerUrlState | undefined => {
const finalState = {};
if (value) {
if (value.options && isMetricExplorerOptions(value.options)) {
Expand Down
Loading

0 comments on commit c5f4ab0

Please sign in to comment.