Skip to content

Commit

Permalink
Merge branch 'master' into rollup_creation_code_to_index_pattern_mgmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Jun 16, 2021
2 parents 452baf6 + 4cf6bca commit cfb8417
Show file tree
Hide file tree
Showing 336 changed files with 8,691 additions and 5,903 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Note that when generating absolute urls, the origin (protocol, host and port) ar
getUrlForApp(appId: string, options?: {
path?: string;
absolute?: boolean;
deepLinkId?: string;
}): string;
```

Expand All @@ -24,7 +25,7 @@ getUrlForApp(appId: string, options?: {
| Parameter | Type | Description |
| --- | --- | --- |
| appId | <code>string</code> | |
| options | <code>{</code><br/><code> path?: string;</code><br/><code> absolute?: boolean;</code><br/><code> }</code> | |
| options | <code>{</code><br/><code> path?: string;</code><br/><code> absolute?: boolean;</code><br/><code> deepLinkId?: string;</code><br/><code> }</code> | |

<b>Returns:</b>

Expand Down
16 changes: 16 additions & 0 deletions docs/discover/search-sessions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,19 @@ behaves differently:
* Relative dates are converted to absolute dates.
* Panning and zooming is disabled for maps.
* Changing a filter, query, or drilldown starts a new search session, which can be slow.

[float]
==== Limitations

Certain visualization features do not fully support background search sessions yet. If a dashboard using these features gets restored,
all panels using unsupported features won't load immediately, but instead send out additional data requests which can take a while to complete.
In this case a warning *Your search session is still running* will be shown.

You can either wait for these additional requests to complete or come back to the dashboard later when all data requests have been finished.

A panel on a dashboard can behave like this if one of the following features is used:
* *Lens* - A *top values* dimension with an enabled setting *Group other values as "Other"* (configurable in the *Advanced* section of the dimension)
* *Lens* - An *intervals* dimension is used
* *Aggregation based* visualizations - A *terms* aggregation is used with an enabled setting *Group other values in separate bucket*
* *Aggregation based* visualizations - A *histogram* aggregation is used
* *Maps* - Layers using joins, blended layers or tracks layers are used
20 changes: 0 additions & 20 deletions docs/user/alerting/domain-specific-rules.asciidoc

This file was deleted.

3 changes: 1 addition & 2 deletions docs/user/alerting/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ include::alerting-setup.asciidoc[]
include::create-and-manage-rules.asciidoc[]
include::defining-rules.asciidoc[]
include::rule-management.asciidoc[]
include::stack-rules.asciidoc[]
include::domain-specific-rules.asciidoc[]
include::rule-types.asciidoc[]
include::alerting-troubleshooting.asciidoc[]
56 changes: 56 additions & 0 deletions docs/user/alerting/rule-types.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[role="xpack"]
[[rule-types]]
== Rule types

A rule is a set of <<alerting-concepts-conditions, conditions>>, <<alerting-concepts-scheduling, schedules>>, and <<alerting-concepts-actions, actions>> that enable notifications. {kib} provides two types of rules: rules specific to the Elastic Stack and rules specific to a domain.

[NOTE]
==============================================
Some rule types are subscription features, while others are free features.
For a comparison of the Elastic subscription levels,
see {subscriptions}[the subscription page].
==============================================

[float]
[[stack-rules]]
=== Stack rules

<<alert-management, Stack rules>> are built into {kib}. To access the *Stack Rules* feature and create and edit rules, users require the `all` privilege. See <<kibana-feature-privileges, feature privileges>> for more information.

[cols="2*<"]
|===

| <<rule-type-index-threshold>>
| Aggregate field values from documents using {es} queries, compare them to threshold values, and schedule actions to run when the thresholds are met.

| <<rule-type-es-query>>
| Run a user-configured {es} query, compare the number of matches to a configured threshold, and schedule actions to run when the threshold condition is met.

|===

[float]
[[domain-specific-rules]]
=== Domain rules

Domain rules are registered by *Observability*, *Security*, <<maps, Maps>> and <<xpack-ml, Machine Learning>>.

[cols="2*<"]
|===

| {observability-guide}/create-alerts.html[Observability rules]
| Detect complex conditions in the *Logs*, *Metrics*, and *Uptime* apps.

| {security-guide}/prebuilt-rules.html[Security rules]
| Detect suspicous source events with pre-built or custom rules and create alerts when a rule’s conditions are met.

| <<geo-alerting, Maps rules>>
| Run an {es} query to determine if any documents are currently contained in any boundaries from a specified boundary index and generate alerts when a rule's conditions are met.

| {ml-docs}/ml-configuring-alerts.html[{ml-cap} rules] beta:[]
| Run scheduled checks on an anomaly detection job to detect anomalies with certain conditions. If an anomaly meets the conditions, an alert is created and the associated action is triggered.

|===

include::rule-types/index-threshold.asciidoc[]
include::rule-types/es-query.asciidoc[]
include::rule-types/geo-rule-types.asciidoc[]
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[role="xpack"]
[[geo-alerting]]
=== Geo rule type
=== Tracking containment

Alerting now includes one additional stack rule: <<rule-type-tracking-containment>>.

As with other stack rules, you need `all` access to the *Stack Rules* feature
to be able to create and edit a geo rule.
See <<kibana-feature-privileges, feature privileges>> for more information on configuring roles that provide access to this feature.
<<maps, Maps>> offers the Tracking containment rule type which runs an {es} query over indices to determine whether any
documents are currently contained within any boundaries from the specified boundary index.
In the event that an entity is contained within a boundary, an alert may be generated.

[float]
==== Geo alerting requirements
To create a *Tracking containment* rule, the following requirements must be present:
==== Requirements
To create a Tracking containment rule, the following requirements must be present:

- *Tracks index or index pattern*: An index containing a `geo_point` field, `date` field,
and some form of entity identifier. An entity identifier is a `keyword` or `number`
Expand All @@ -29,22 +27,12 @@ than the current time minus the amount of the interval. If data older than
`now - <current interval>` is ingested, it won't trigger a rule.

[float]
==== Creating a geo rule
Click the *Create* button in the <<create-and-manage-rules, rule management UI>>.
Complete the <<defining-rules-general-details, general rule details>>.

[role="screenshot"]
image::user/alerting/images/alert-types-tracking-select.png[Choosing a tracking rule type]
==== Create the rule

[float]
[[rule-type-tracking-containment]]
==== Tracking containment
The Tracking containment rule type runs an {es} query over indices, determining if any
documents are currently contained within any boundaries from the specified boundary index.
In the event that an entity is contained within a boundary, an alert may be generated.
Fill in the <<defining-rules-general-details, rule details>>, then select Tracking containment.

[float]
===== Defining the conditions
==== Define the conditions
Tracking containment rules have 3 clauses that define the condition to detect,
as well as 2 Kuery bars used to provide additional filtering context for each of the indices.

Expand All @@ -61,6 +49,9 @@ Index (Boundary):: This clause requires an *index or index pattern*, a *`geo_sha
identifying boundaries, and an optional *Human-readable boundary name* for better alerting
messages.

[float]
==== Add action

Conditions for how a rule is tracked can be specified uniquely for each individual action.
A rule can be triggered either when a containment condition is met or when an entity
is no longer contained.
Expand Down
27 changes: 0 additions & 27 deletions docs/user/alerting/stack-rules.asciidoc

This file was deleted.

13 changes: 10 additions & 3 deletions docs/user/dashboard/aggregation-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This reference can help simplify the comparison if you need a specific feature.

| Table with summary row
^| X
|
^| X
|
|
|
Expand Down Expand Up @@ -65,7 +65,7 @@ This reference can help simplify the comparison if you need a specific feature.

| Heat map
^| X
|
^| X
|
|
^| X
Expand Down Expand Up @@ -333,7 +333,7 @@ build their advanced visualization.

| Math on aggregated data
|
|
^| X
^| X
^| X
^| X
Expand All @@ -352,6 +352,13 @@ build their advanced visualization.
^| X
^| X

| Time shifts
|
^| X
^| X
^| X
^| X

| Fully custom {es} queries
|
|
Expand Down
5 changes: 4 additions & 1 deletion docs/user/dashboard/create-panels-with-editors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
[[lens-editor]]
=== Lens

*Lens* is the drag and drop editor that creates visualizations of your data.
*Lens* is the drag and drop editor that creates visualizations of your data, recommended for most
users.

With *Lens*, you can:

* Use the automatically generated suggestions to change the visualization type.
* Create visualizations with multiple layers and indices.
* Change the aggregation and labels to customize the data.
* Perform math on aggregations using *Formula*.
* Use time shifts to compare data at two times, such as month over month.

[role="screenshot"]
image:dashboard/images/lens_advanced_1_1.png[Lens]
Expand Down
4 changes: 3 additions & 1 deletion docs/user/dashboard/lens.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ image::images/lens_missing_values_strategy.png[Lens Missing values strategies me
[[is-it-possible-to-change-the-scale-of-Y-axis]]
===== Is it possible to statically define the scale of the y-axis in a visualization?

The ability to start the y-axis from another value than 0, or use a logarithmic scale, is unsupported in *Lens*.
Yes, you can set the bounds on bar, line and area chart types in Lens, unless using percentage mode. Bar
and area charts must have 0 in the bounds. Logarithmic scales are unsupported in *Lens*.
To set the y-axis bounds, click the icon representing the axis you want to customize.

[float]
[[is-it-possible-to-have-pagination-for-datatable]]
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
"cytoscape-dagre": "^2.2.2",
"d3": "3.5.17",
"d3-array": "1.2.4",
"d3-cloud": "1.2.5",
"d3-scale": "1.0.7",
"d3-shape": "^1.1.0",
"d3-time": "^1.1.0",
Expand Down Expand Up @@ -671,7 +670,7 @@
"callsites": "^3.1.0",
"chai": "3.5.0",
"chance": "1.0.18",
"chromedriver": "^90.0.0",
"chromedriver": "^91.0.1",
"clean-webpack-plugin": "^3.0.0",
"cmd-shim": "^2.1.0",
"compression-webpack-plugin": "^4.0.0",
Expand Down Expand Up @@ -839,4 +838,4 @@
"yargs": "^15.4.1",
"zlib": "^1.0.5"
}
}
}
37 changes: 29 additions & 8 deletions packages/kbn-test/src/jest/utils/router_helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,39 @@

import React, { Component, ComponentType } from 'react';
import { MemoryRouter, Route, withRouter } from 'react-router-dom';
import * as H from 'history';
import { History, LocationDescriptor } from 'history';

export const WithMemoryRouter = (initialEntries: string[] = ['/'], initialIndex: number = 0) => (
WrappedComponent: ComponentType
) => (props: any) => (
const stringifyPath = (path: LocationDescriptor): string => {
if (typeof path === 'string') {
return path;
}

return path.pathname || '/';
};

const locationDescriptorToRoutePath = (
paths: LocationDescriptor | LocationDescriptor[]
): string | string[] => {
if (Array.isArray(paths)) {
return paths.map((path: LocationDescriptor) => {
return stringifyPath(path);
});
}

return stringifyPath(paths);
};

export const WithMemoryRouter = (
initialEntries: LocationDescriptor[] = ['/'],
initialIndex: number = 0
) => (WrappedComponent: ComponentType) => (props: any) => (
<MemoryRouter initialEntries={initialEntries} initialIndex={initialIndex}>
<WrappedComponent {...props} />
</MemoryRouter>
);

export const WithRoute = (
componentRoutePath: string | string[] = '/',
componentRoutePath: LocationDescriptor | LocationDescriptor[] = ['/'],
onRouter = (router: any) => {}
) => (WrappedComponent: ComponentType) => {
// Create a class component that will catch the router
Expand All @@ -40,16 +61,16 @@ export const WithRoute = (

return (props: any) => (
<Route
path={componentRoutePath}
path={locationDescriptorToRoutePath(componentRoutePath)}
render={(routerProps) => <CatchRouter {...routerProps} {...props} />}
/>
);
};

interface Router {
history: Partial<H.History>;
history: Partial<History>;
route: {
location: H.Location;
location: LocationDescriptor;
};
}

Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-test/src/jest/utils/testbed/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { Store } from 'redux';
import { ReactWrapper } from 'enzyme';
import { LocationDescriptor } from 'history';

export type SetupFunc<T> = (props?: any) => TestBed<T> | Promise<TestBed<T>>;

Expand Down Expand Up @@ -161,11 +162,11 @@ export interface MemoryRouterConfig {
/** Flag to add or not the `MemoryRouter`. If set to `false`, there won't be any router and the component won't be wrapped on a `<Route />`. */
wrapComponent?: boolean;
/** The React Router **initial entries** setting ([see documentation](https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/MemoryRouter.md)) */
initialEntries?: string[];
initialEntries?: LocationDescriptor[];
/** The React Router **initial index** setting ([see documentation](https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/MemoryRouter.md)) */
initialIndex?: number;
/** The route **path** for the mounted component (defaults to `"/"`) */
componentRoutePath?: string | string[];
componentRoutePath?: LocationDescriptor | LocationDescriptor[];
/** A callBack that will be called with the React Router instance once mounted */
onRouter?: (router: any) => void;
}
Expand Down
Loading

0 comments on commit cfb8417

Please sign in to comment.