Skip to content

Commit ea928d2

Browse files
authored
Merge branch 'main' into markdown
2 parents 4bc7e51 + 8c54dca commit ea928d2

File tree

449 files changed

+2065
-1325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

449 files changed

+2065
-1325
lines changed

.eslintrc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,10 @@ module.exports = {
11111111
},
11121112
overrides: [
11131113
{
1114-
files: ['x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}'],
1114+
files: [
1115+
'x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}',
1116+
'x-pack/plugins/cases/public/**/*.{js,mjs,ts,tsx}',
1117+
],
11151118
rules: {
11161119
'@typescript-eslint/consistent-type-imports': 'error',
11171120
},

docs/apm/apm-app-users.asciidoc

+32-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Select your use-case to get started:
2828
* <<apm-app-reader>>
2929
* <<apm-app-annotation-user-create>>
3030
* <<apm-app-central-config-user>>
31+
* <<apm-app-storage-explorer-user-create>>
3132
* <<apm-app-api-user>>
3233

3334
////
@@ -53,11 +54,12 @@ To create an APM reader user:
5354
. Create a new role, named something like `read-apm`, and assign the following privileges:
5455
+
5556
--
57+
:apm-read-view:
58+
:apm-monitor:
5659
include::./tab-widgets/apm-app-reader/widget.asciidoc[]
60+
:!apm-read-view:
61+
:!apm-monitor:
5762
--
58-
+
59-
TIP: Using the deprecated APM Server binaries?
60-
Add the privileges under the **Classic APM indices** tab above.
6163

6264
. Assign the `read-apm` role created in the previous step, and the following built-in roles to
6365
any APM reader users:
@@ -83,9 +85,6 @@ In some instances, you may wish to restrict certain Kibana apps that a user has
8385
--
8486
include::./tab-widgets/apm-app-reader/widget.asciidoc[]
8587
--
86-
+
87-
TIP: Using the deprecated APM Server binaries?
88-
Add the privileges under the **Classic APM indices** tab above.
8988

9089
. Assign feature privileges to any Kibana feature that the user needs access to.
9190
Here are two examples:
@@ -235,6 +234,33 @@ See <<apm-app-api-user>>.
235234
*********************************** ***********************************
236235
////
237236

237+
[role="xpack"]
238+
[[apm-app-storage-explorer-user-create]]
239+
=== APM app storage explorer user
240+
241+
++++
242+
<titleabbrev>Create a storage explorer user</titleabbrev>
243+
++++
244+
245+
[[apm-app-storage-explorer-user]]
246+
==== Storage explorer user
247+
248+
View the **Storage explorer** in the APM app.
249+
250+
. Create a new role, named something like `storage-explorer_user`,
251+
and assign the following privileges:
252+
+
253+
--
254+
include::./tab-widgets/storage-explorer-user/widget.asciidoc[]
255+
--
256+
257+
. Assign the `storage-explorer_user` created previously, and the roles and privileges necessary to create
258+
a <<apm-app-reader-full,full>> or <<apm-app-reader-partial,partial>> APM reader to any users that need to view **Storage explorer** in the APM app.
259+
260+
////
261+
*********************************** ***********************************
262+
////
263+
238264
[role="xpack"]
239265
[[apm-app-api-user]]
240266
=== APM app API user

docs/apm/how-to-guides.asciidoc

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Learn how to perform common APM app tasks.
1414
* <<machine-learning-integration>>
1515
* <<apm-lambda>>
1616
* <<advanced-queries>>
17+
* <<storage-explorer>>
1718
* <<transactions-annotations>>
1819

1920

@@ -35,4 +36,6 @@ include::lambda.asciidoc[]
3536

3637
include::advanced-queries.asciidoc[]
3738

39+
include::storage-explorer.asciidoc[]
40+
3841
include::deployment-annotations.asciidoc[]
1.03 MB
Loading
1.18 MB
Loading

docs/apm/storage-explorer.asciidoc

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[[storage-explorer]]
2+
=== Storage explorer
3+
4+
beta::[]
5+
6+
Analyze your APM data and manage costs with **storage explorer**.
7+
For example, analyze the storage footprint of each of your services to see which are producing
8+
large amounts of data--then change the sample rate of a service to lower the amount of data ingested.
9+
Or, expand the time filter to visualize data trends over time so that you can better forecast
10+
and prepare for future storage needs.
11+
12+
[role="screenshot"]
13+
image::apm/images/storage-explorer-overview.png[APM Storage explorer]
14+
15+
[float]
16+
==== Index lifecycle phases
17+
18+
A default {apm-guide-ref}/ilm-how-to.html[index lifecycle policy] is applied to each APM data stream,
19+
but can be customized depending on your business needs.
20+
Use the **Index lifecycle phase** dropdown to visualize and analyze your storage by phase.
21+
22+
Customizing the default APM index lifecycle policies can save money by specifying things like:
23+
24+
* The point at which an index can be moved to less performant hardware.
25+
* The point at which availability is not as critical and the number of replicas can be reduced.
26+
* When the index can be safely deleted.
27+
28+
See {apm-guide-ref}/ilm-how-to.html[Index lifecycle management] to learn more about customizing
29+
the default APM index lifecycle policies.
30+
31+
[float]
32+
==== Service size chart
33+
34+
The service size chart displays the estimated size of each service over time.
35+
Expand the time filter to visualize data trends and estimate daily data generation.
36+
37+
[float]
38+
==== Service statistics table
39+
40+
The service statistics table provides detailed information on each service:
41+
42+
* A list of **service environments**.
43+
* The **sampling rate**. This value is calculated by dividing the number of sampled transactions by total throughput.
44+
It might differ from the configured sampling rate for two reasons: with head-based sampling,
45+
the initial service makes the sampling decision, and with tail-based sampling,
46+
granular policies allow you to set multiple sample rates.
47+
* The estimated **size on disk**. This storage size includes both primary and replica shards and is
48+
calculated by prorating the total size of your indices by the service's document count divided by
49+
the total number of documents.
50+
* Number of **transactions**, **spans**, **errors**, and **metrics** — doc count and size on disk.
51+
52+
[role="screenshot"]
53+
image::apm/images/storage-explorer-expanded.png[APM Storage explorer service breakdown]
54+
55+
As you explore your service statistics, you might want to take action to reduce the number of
56+
documents and therefore storage size of a particular service.
57+
58+
[float]
59+
===== Reduce the number of transactions
60+
To reduce the number of transactions a service generates, configure a more aggressive
61+
{apm-guide-ref}/sampling.html[transaction sampling policy]. Transaction sampling lowers
62+
the amount of data ingested without negatively impacting the usefulness of your data.
63+
64+
[float]
65+
===== Reduce the number of spans
66+
To reduce the number of spans a service generates, enable
67+
{apm-guide-ref}/span-compression.html[span compression]. Span compression saves on data
68+
and transfer costs by compressing multiple, similar spans into a single span.
69+
70+
[float]
71+
===== Reduce the number of metrics
72+
To reduce the number of system, runtime, and application metrics,
73+
tune the APM agent or agents that are collecting the data.
74+
You can disable the collection of specific metrics with the **disable metrics** configuration.
75+
Or, you can set the **metrics interval** to zero seconds to deactivate metrics entirely.
76+
Most APM agents support both options.
77+
See the relevant {apm-agents-ref}[agent configuration options] for more details.
78+
79+
[float]
80+
===== Reduce the number of errors
81+
To reduce the number of errors a service generate,
82+
work with your developers to change how exceptions are handled in your code.
83+
84+
[float]
85+
==== Privileges
86+
87+
Storage explorer requires expanded privileges to view.
88+
See <<apm-app-storage-explorer-user-create>> for more information.
89+
90+
[float]
91+
==== Limitations
92+
93+
Multi-cluster deployments are not supported.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// tag::classic-indices[]
2+
[options="header"]
3+
|====
4+
|Type |Privilege |Purpose
5+
6+
|Index
7+
|`monitor` on `apm-*`
8+
|Monitor access to `apm-*` for storage explorer
9+
|====
10+
// end::classic-indices[]
11+
12+
// tag::data-streams[]
13+
[options="header"]
14+
|====
15+
|Type |Privilege |Purpose
16+
17+
|Index
18+
|`monitor` on `logs-apm*`
19+
|Monitor access to `logs-apm*` for storage explorer
20+
21+
|Index
22+
|`monitor` on `metrics-apm*`
23+
|Monitor access to `metrics-apm*` for storage explorer
24+
25+
|Index
26+
|`monitor` on `traces-apm*`
27+
|Monitor access to `traces-apm*` for storage explorer
28+
|====
29+
// end::data-streams[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
++++
2+
<div class="tabs" data-tab-group="apm-app-storage-explorer-reader">
3+
<div role="tablist" aria-label="APM app storage explorer-reader">
4+
<button role="tab"
5+
aria-selected="true"
6+
aria-controls="data-streams-tab"
7+
id="data-streams">
8+
Data streams
9+
</button>
10+
<button role="tab"
11+
aria-selected="false"
12+
aria-controls="classic-indices-tab"
13+
id="classic-indices"
14+
tabindex="-1">
15+
Classic APM indices
16+
</button>
17+
</div>
18+
<div tabindex="0"
19+
role="tabpanel"
20+
id="data-streams-tab"
21+
aria-labelledby="data-streams">
22+
++++
23+
24+
include::content.asciidoc[tag=data-streams]
25+
26+
++++
27+
</div>
28+
<div tabindex="0"
29+
role="tabpanel"
30+
id="classic-indices-tab"
31+
aria-labelledby="classic-indices"
32+
hidden="">
33+
++++
34+
35+
include::content.asciidoc[tag=classic-indices]
36+
37+
++++
38+
</div>
39+
</div>
40+
++++
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
import { createBrowserHistory } from 'history';
9+
import { getState } from '../application/main/services/discover_state';
10+
import { savedSearchMockWithTimeField, savedSearchMock } from './saved_search';
11+
import { discoverServiceMock } from './services';
12+
13+
export function getDiscoverStateMock({ isTimeBased = true }) {
14+
const history = createBrowserHistory();
15+
history.push('/');
16+
return getState({
17+
savedSearch: isTimeBased ? savedSearchMockWithTimeField : savedSearchMock,
18+
services: discoverServiceMock,
19+
history,
20+
});
21+
}

src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx

+14-1
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,20 @@ import { LocalStorageMock } from '../../../../__mocks__/local_storage_mock';
3737
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
3838
import { DiscoverServices } from '../../../../build_services';
3939
import { buildDataTableRecord } from '../../../../utils/build_data_record';
40+
import { DiscoverAppStateProvider } from '../../services/discover_app_state_container';
41+
import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock';
4042

4143
setHeaderActionMenuMounter(jest.fn());
4244

45+
function getAppStateContainer() {
46+
const appStateContainer = getDiscoverStateMock({ isTimeBased: true }).appStateContainer;
47+
appStateContainer.set({
48+
query: { query: '', language: 'lucene' },
49+
filters: [],
50+
});
51+
return appStateContainer;
52+
}
53+
4354
function mountComponent(
4455
dataView: DataView,
4556
prevSidebarClosed?: boolean,
@@ -167,7 +178,9 @@ function mountComponent(
167178

168179
return mountWithIntl(
169180
<KibanaContextProvider services={services}>
170-
<DiscoverLayout {...(props as DiscoverLayoutProps)} />
181+
<DiscoverAppStateProvider value={getAppStateContainer()}>
182+
<DiscoverLayout {...(props as DiscoverLayoutProps)} />
183+
</DiscoverAppStateProvider>
171184
</KibanaContextProvider>,
172185
mountOptions
173186
);

src/plugins/discover/public/application/main/components/layout/discover_layout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ export function DiscoverLayout({
251251
onRemoveField={onRemoveColumn}
252252
onChangeDataView={onChangeDataView}
253253
selectedDataView={dataView}
254-
state={state}
255254
isClosed={isSidebarClosed}
256255
trackUiMetric={trackUiMetric}
257256
useNewFieldsApi={useNewFieldsApi}

src/plugins/discover/public/application/main/components/sidebar/discover_field.test.tsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { DiscoverField, DiscoverFieldProps } from './discover_field';
1919
import { DataViewField } from '@kbn/data-views-plugin/public';
2020
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
2121
import { stubDataView } from '@kbn/data-views-plugin/common/data_view.stub';
22+
import { DiscoverAppStateProvider } from '../../services/discover_app_state_container';
23+
import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock';
2224

2325
jest.mock('@kbn/unified-field-list-plugin/public/services/field_stats', () => ({
2426
loadFieldStats: jest.fn().mockResolvedValue({
@@ -88,10 +90,6 @@ async function getComponent({
8890
onRemoveField: jest.fn(),
8991
showFieldStats,
9092
selected,
91-
state: {
92-
query: { query: '', language: 'lucene' },
93-
filters: [],
94-
},
9593
contextualFields: [],
9694
};
9795
const services = {
@@ -135,9 +133,16 @@ async function getComponent({
135133
fieldFormats: fieldFormatsServiceMock.createStartContract(),
136134
charts: chartPluginMock.createSetupContract(),
137135
};
136+
const appStateContainer = getDiscoverStateMock({ isTimeBased: true }).appStateContainer;
137+
appStateContainer.set({
138+
query: { query: '', language: 'lucene' },
139+
filters: [],
140+
});
138141
const comp = await mountWithIntl(
139142
<KibanaContextProvider services={services}>
140-
<DiscoverField {...props} />
143+
<DiscoverAppStateProvider value={appStateContainer}>
144+
<DiscoverField {...props} />
145+
</DiscoverAppStateProvider>
141146
</KibanaContextProvider>
142147
);
143148
// wait for lazy modules

0 commit comments

Comments
 (0)