Skip to content

Commit

Permalink
Merge branch 'main' into chore/update-slo-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme authored Aug 8, 2023
2 parents f57b64f + f9f2d37 commit 0658cdf
Show file tree
Hide file tree
Showing 140 changed files with 4,520 additions and 1,389 deletions.
1 change: 1 addition & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ enabled:
- x-pack/test/functional/config_security_basic.ts
- x-pack/test/functional/config.ccs.ts
- x-pack/test/functional/config.firefox.js
- x-pack/test/functional/config.upgrade_assistant.ts
- x-pack/test/functional_cloud/config.ts
- x-pack/test/kubernetes_security/basic/config.ts
- x-pack/test/licensing_plugin/config.public.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,10 @@ Predicting the buffer required to account for actions depends heavily on the rul

experimental[]

Alerts and actions log activity in a set of "event log" indices. These indices are configured with an index lifecycle management (ILM) policy, which you can customize. The default policy rolls over the index when it reaches 50GB, or after 30 days. Indices over 90 days old are deleted.
Alerts and actions log activity in a set of "event log" data streams, one per Kibana version, named `.kibana-event-log-{VERSION}`. These data streams are configured with a lifecycle data retention of 90 days. This can be updated to other values via the standard data stream lifecycle APIs. Note that the event log data contains the data shown in the alerting pages in {kib}, so reducing the data retention period will result in less data being available to view.

The name of the index policy is `kibana-event-log-policy`. {kib} creates the index policy on startup, if it doesn't already exist. The index policy can be customized for your environment, but {kib} never modifies the index policy after creating it.

Because {kib} uses the documents to display historic data, you should set the delete phase longer than you would like the historic data to be shown. For example, if you would like to see one month's worth of historic data, you should set the delete phase to at least one month.

For more information on index lifecycle management, see:
{ref}/index-lifecycle-management.html[Index Lifecycle Policies].
For more information on data stream lifecycle management, see:
{ref}/data-stream-lifecycle.html[Data stream lifecycle].

[float]
[[alerting-circuit-breakers]]
Expand Down
15 changes: 9 additions & 6 deletions examples/expressions_explorer/public/actions_and_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import {
EuiFlexItem,
EuiFlexGroup,
EuiPageBody,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageTemplate,
EuiPageSection,
EuiPageHeader,
EuiPageHeaderSection,
EuiPanel,
EuiText,
EuiTitle,
EuiSpacer,
} from '@elastic/eui';
import { ExpressionsStart } from '@kbn/expressions-plugin/public';
import { UiActionsStart } from '@kbn/ui-actions-plugin/public';
Expand Down Expand Up @@ -55,8 +56,8 @@ export function ActionsExpressionsExample({ expressions, actions }: Props) {
</EuiTitle>
</EuiPageHeaderSection>
</EuiPageHeader>
<EuiPageContent data-test-subj="expressionsActionsTest">
<EuiPageContentBody>
<EuiPageTemplate.Section data-test-subj="expressionsActionsTest">
<EuiPageSection>
<EuiFlexGroup>
<EuiFlexItem>
<EuiText>
Expand All @@ -67,6 +68,8 @@ export function ActionsExpressionsExample({ expressions, actions }: Props) {
</EuiFlexItem>
</EuiFlexGroup>

<EuiSpacer />

<EuiFlexGroup gutterSize="l">
<EuiFlexItem>
<EuiPanel data-test-subj="expressionEditor" paddingSize="none" role="figure">
Expand All @@ -86,8 +89,8 @@ export function ActionsExpressionsExample({ expressions, actions }: Props) {
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageContentBody>
</EuiPageContent>
</EuiPageSection>
</EuiPageTemplate.Section>
</EuiPageBody>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import {
EuiFlexItem,
EuiFlexGroup,
EuiPageBody,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageTemplate,
EuiPageSection,
EuiPageHeader,
EuiPageHeaderSection,
EuiPanel,
EuiText,
EuiTitle,
EuiSpacer,
} from '@elastic/eui';
import { ExpressionsStart } from '@kbn/expressions-plugin/public';
import { UiActionsStart } from '@kbn/ui-actions-plugin/public';
Expand Down Expand Up @@ -54,8 +55,8 @@ export function ActionsExpressionsExample2({ expressions, actions }: Props) {
</EuiTitle>
</EuiPageHeaderSection>
</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody data-test-subj="expressionsVariablesTest">
<EuiPageTemplate.Section>
<EuiPageSection data-test-subj="expressionsVariablesTest">
<EuiFlexGroup>
<EuiFlexItem>
<EuiText>
Expand All @@ -65,6 +66,8 @@ export function ActionsExpressionsExample2({ expressions, actions }: Props) {
</EuiFlexItem>
</EuiFlexGroup>

<EuiSpacer />

<EuiFlexGroup gutterSize="l">
<EuiFlexItem>
<EuiPanel data-test-subj="expressionEditor" paddingSize="none" role="figure">
Expand All @@ -86,8 +89,8 @@ export function ActionsExpressionsExample2({ expressions, actions }: Props) {
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageContentBody>
</EuiPageContent>
</EuiPageSection>
</EuiPageTemplate.Section>
</EuiPageBody>
);
}
16 changes: 9 additions & 7 deletions examples/expressions_explorer/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
EuiPage,
EuiPageHeader,
EuiPageBody,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageTemplate,
EuiPageSection,
EuiSpacer,
EuiText,
EuiLink,
Expand Down Expand Up @@ -55,9 +55,11 @@ const ExpressionsExplorer = ({
<KibanaReactContextProvider>
<EuiPage>
<EuiPageBody>
<EuiPageHeader>Expressions Explorer</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody>
<EuiPageSection>
<EuiPageHeader pageTitle="Expressions Explorer" />
</EuiPageSection>
<EuiPageTemplate.Section>
<EuiPageSection>
<EuiText>
<p>
There are a couple of ways to run the expressions. Below some of the options are
Expand Down Expand Up @@ -87,8 +89,8 @@ const ExpressionsExplorer = ({
<EuiSpacer />

<ActionsExpressionsExample2 expressions={expressions} actions={actions} />
</EuiPageContentBody>
</EuiPageContent>
</EuiPageSection>
</EuiPageTemplate.Section>
</EuiPageBody>
</EuiPage>
</KibanaReactContextProvider>
Expand Down
15 changes: 9 additions & 6 deletions examples/expressions_explorer/public/render_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import {
EuiFlexItem,
EuiFlexGroup,
EuiPageBody,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageTemplate,
EuiPageSection,
EuiPageHeader,
EuiPageHeaderSection,
EuiPanel,
EuiText,
EuiTitle,
EuiButton,
EuiSpacer,
} from '@elastic/eui';
import { ExpressionsStart } from '@kbn/expressions-plugin/public';
import { Start as InspectorStart } from '@kbn/inspector-plugin/public';
Expand Down Expand Up @@ -49,8 +50,8 @@ export function RenderExpressionsExample({ expressions, inspector }: Props) {
</EuiTitle>
</EuiPageHeaderSection>
</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody>
<EuiPageTemplate.Section>
<EuiPageSection>
<EuiFlexGroup>
<EuiFlexItem>
<EuiText>
Expand All @@ -69,6 +70,8 @@ export function RenderExpressionsExample({ expressions, inspector }: Props) {
</EuiFlexItem>
</EuiFlexGroup>

<EuiSpacer />

<EuiFlexGroup gutterSize="l">
<EuiFlexItem>
<EuiPanel data-test-subj="expressionEditor" paddingSize="none" role="figure">
Expand All @@ -90,8 +93,8 @@ export function RenderExpressionsExample({ expressions, inspector }: Props) {
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageContentBody>
</EuiPageContent>
</EuiPageSection>
</EuiPageTemplate.Section>
</EuiPageBody>
);
}
15 changes: 9 additions & 6 deletions examples/expressions_explorer/public/run_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import {
EuiFlexItem,
EuiFlexGroup,
EuiPageBody,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageTemplate,
EuiPageSection,
EuiPageHeader,
EuiPageHeaderSection,
EuiPanel,
EuiText,
EuiTitle,
EuiButton,
EuiSpacer,
} from '@elastic/eui';
import { ExpressionsStart } from '@kbn/expressions-plugin/public';
import { Adapters, Start as InspectorStart } from '@kbn/inspector-plugin/public';
Expand Down Expand Up @@ -64,8 +65,8 @@ export function RunExpressionsExample({ expressions, inspector }: Props) {
</EuiTitle>
</EuiPageHeaderSection>
</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody>
<EuiPageTemplate.Section>
<EuiPageSection>
<EuiFlexGroup>
<EuiFlexItem>
<EuiText>
Expand All @@ -84,6 +85,8 @@ export function RunExpressionsExample({ expressions, inspector }: Props) {
</EuiFlexItem>
</EuiFlexGroup>

<EuiSpacer />

<EuiFlexGroup gutterSize="l">
<EuiFlexItem>
<EuiPanel data-test-subj="expressionEditor" paddingSize="none" role="figure">
Expand All @@ -104,8 +107,8 @@ export function RunExpressionsExample({ expressions, inspector }: Props) {
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageContentBody>
</EuiPageContent>
</EuiPageSection>
</EuiPageTemplate.Section>
</EuiPageBody>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ describe('breadcrumbs', () => {
const currentLocationPathName = '/foo/item1';
const { projectNavigation, history } = setup({ locationPathName: currentLocationPathName });

projectNavigation.setProjectNavigation({
const mockNavigation = {
navigationTree: [
{
id: 'root',
title: 'Root',
path: ['root'],
breadcrumbStatus: 'hidden',
breadcrumbStatus: 'hidden' as 'hidden',
children: [
{
id: 'subNav',
Expand All @@ -64,8 +64,9 @@ describe('breadcrumbs', () => {
],
},
],
});
return { projectNavigation, history };
};
projectNavigation.setProjectNavigation(mockNavigation);
return { projectNavigation, history, mockNavigation };
};

test('should set breadcrumbs home / nav / custom', async () => {
Expand Down Expand Up @@ -151,6 +152,42 @@ describe('breadcrumbs', () => {
breadcrumbs = await firstValueFrom(projectNavigation.getProjectBreadcrumbs$());
expect(breadcrumbs).toHaveLength(1); // only home is left
});

// this handles race condition where the final `setProjectNavigation` update happens after the app called `setProjectBreadcrumbs`
test("shouldn't reset initial deep context breadcrumbs", async () => {
const { projectNavigation, mockNavigation } = setupWithNavTree();
projectNavigation.setProjectNavigation({ navigationTree: [] }); // reset simulating initial state
projectNavigation.setProjectBreadcrumbs([
{ text: 'custom1', href: '/custom1' },
{ text: 'custom2', href: '/custom1/custom2' },
]);
projectNavigation.setProjectNavigation(mockNavigation); // restore navigation

const breadcrumbs = await firstValueFrom(projectNavigation.getProjectBreadcrumbs$());
expect(breadcrumbs).toHaveLength(4);
});

test("shouldn't reset custom breadcrumbs when nav node contents changes, but not the path", async () => {
const { projectNavigation, mockNavigation } = setupWithNavTree();
projectNavigation.setProjectBreadcrumbs([
{ text: 'custom1', href: '/custom1' },
{ text: 'custom2', href: '/custom1/custom2' },
]);
let breadcrumbs = await firstValueFrom(projectNavigation.getProjectBreadcrumbs$());
expect(breadcrumbs).toHaveLength(4);

// navigation node contents changed, but not the path
projectNavigation.setProjectNavigation({
navigationTree: [
{ ...mockNavigation.navigationTree[0], title: 'Changed title' },
...mockNavigation.navigationTree,
],
});

// context breadcrumbs should not reset
breadcrumbs = await firstValueFrom(projectNavigation.getProjectBreadcrumbs$());
expect(breadcrumbs).toHaveLength(4);
});
});

describe('getActiveNodes$()', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ import {
ChromeProjectNavigationNode,
} from '@kbn/core-chrome-browser';
import type { HttpStart } from '@kbn/core-http-browser';
import { BehaviorSubject, Observable, combineLatest, map, takeUntil, ReplaySubject } from 'rxjs';
import {
BehaviorSubject,
Observable,
combineLatest,
map,
takeUntil,
ReplaySubject,
skip,
distinctUntilChanged,
skipWhile,
} from 'rxjs';
import type { Location } from 'history';
import deepEqual from 'react-fast-compare';
import classnames from 'classnames';
Expand Down Expand Up @@ -55,10 +65,25 @@ export class ProjectNavigationService {
this.onHistoryLocationChange(application.history.location);
this.unlistenHistory = application.history.listen(this.onHistoryLocationChange.bind(this));

this.activeNodes$.pipe(takeUntil(this.stop$)).subscribe(() => {
// reset the breadcrumbs when the active nodes change
this.projectBreadcrumbs$.next({ breadcrumbs: [], params: { absolute: false } });
});
this.activeNodes$
.pipe(
takeUntil(this.stop$),
// skip while the project navigation is not set
skipWhile(() => !this.projectNavigation$.getValue()),
// only reset when the active breadcrumb path changes, use ids to get more stable reference
distinctUntilChanged((prevNodes, nextNodes) =>
deepEqual(
prevNodes?.[0]?.map((node) => node.id),
nextNodes?.[0]?.map((node) => node.id)
)
),
// skip the initial state, we only want to reset the breadcrumbs when the active nodes change
skip(1)
)
.subscribe(() => {
// reset the breadcrumbs when the active nodes change
this.projectBreadcrumbs$.next({ breadcrumbs: [], params: { absolute: false } });
});

return {
setProjectHome: (homeHref: string) => {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
overview: `${KIBANA_DOCS}upgrade-assistant.html`,
batchReindex: `${KIBANA_DOCS}batch-start-resume-reindex.html`,
remoteReindex: `${ELASTICSEARCH_DOCS}docs-reindex.html#reindex-from-remote`,
reindexWithPipeline: `${ELASTICSEARCH_DOCS}docs-reindex.html#reindex-with-an-ingest-pipeline`,
},
rollupJobs: `${KIBANA_DOCS}data-rollups.html`,
elasticsearch: {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export interface DocLinks {
readonly overview: string;
readonly batchReindex: string;
readonly remoteReindex: string;
readonly reindexWithPipeline: string;
};
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
Expand Down
Loading

0 comments on commit 0658cdf

Please sign in to comment.