Skip to content

Commit a2c7d1d

Browse files
Merge branch '7.x' into backport/7.x/pr-62865
2 parents 0514246 + 237c0f1 commit a2c7d1d

123 files changed

Lines changed: 2341 additions & 2327 deletions

File tree

Some content is hidden

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

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ target
2525
/src/plugins/vis_type_timelion/public/_generated_/**
2626
/src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
2727
/x-pack/legacy/plugins/**/__tests__/fixtures/**
28-
/x-pack/legacy/plugins/apm/e2e/cypress/**/snapshots.js
28+
/x-pack/plugins/apm/e2e/cypress/**/snapshots.js
2929
/x-pack/legacy/plugins/canvas/canvas_plugin
3030
/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts
3131
/x-pack/legacy/plugins/canvas/shareable_runtime/build

.eslintrc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ module.exports = {
310310
{
311311
files: [
312312
'x-pack/test/functional/apps/**/*.js',
313-
'x-pack/legacy/plugins/apm/**/*.js',
313+
'x-pack/plugins/apm/**/*.js',
314314
'test/*/config.ts',
315315
'test/*/config_open.ts',
316316
'test/*/{tests,test_suites,apis,apps}/**/*',
@@ -397,7 +397,7 @@ module.exports = {
397397
'x-pack/**/*.test.js',
398398
'x-pack/test_utils/**/*',
399399
'x-pack/gulpfile.js',
400-
'x-pack/legacy/plugins/apm/public/utils/testHelpers.js',
400+
'x-pack/plugins/apm/public/utils/testHelpers.js',
401401
],
402402
rules: {
403403
'import/no-extraneous-dependencies': [
@@ -523,15 +523,15 @@ module.exports = {
523523
* APM overrides
524524
*/
525525
{
526-
files: ['x-pack/legacy/plugins/apm/**/*.js'],
526+
files: ['x-pack/plugins/apm/**/*.js'],
527527
rules: {
528528
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
529529
'no-console': ['warn', { allow: ['error'] }],
530530
},
531531
},
532532
{
533533
plugins: ['react-hooks'],
534-
files: ['x-pack/legacy/plugins/apm/**/*.{ts,tsx}'],
534+
files: ['x-pack/plugins/apm/**/*.{ts,tsx}'],
535535
rules: {
536536
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
537537
'react-hooks/exhaustive-deps': ['error', { additionalHooks: '^useFetcher$' }],

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ package-lock.json
4444
*.sublime-*
4545
npm-debug.log*
4646
.tern-project
47-
x-pack/legacy/plugins/apm/tsconfig.json
47+
x-pack/plugins/apm/tsconfig.json
4848
apm.tsconfig.json
49-
/x-pack/legacy/plugins/apm/e2e/snapshots.js
49+
/x-pack/plugins/apm/e2e/snapshots.js

docs/visualize/timelion.asciidoc

Lines changed: 115 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ To compare the two data sets, add another series with data from the previous hou
5050
.es(index=metricbeat-*,
5151
timefield='@timestamp',
5252
metric='avg:system.cpu.user.pct'),
53-
.es(offset=-1h, <1>
54-
index=metricbeat-*,
55-
timefield='@timestamp',
56-
metric='avg:system.cpu.user.pct')
53+
.es(offset=-1h, <1>
54+
index=metricbeat-*,
55+
timefield='@timestamp',
56+
metric='avg:system.cpu.user.pct')
5757
----------------------------------
5858

5959
<1> `offset` offsets the data retrieval by a date expression. In this example, `-1h` offsets the data back by one hour.
@@ -119,11 +119,11 @@ To differentiate between the current hour data and the last hour data, change th
119119
metric='avg:system.cpu.user.pct')
120120
.label('last hour')
121121
.lines(fill=1,width=0.5), <1>
122-
.es(index=metricbeat-*,
123-
timefield='@timestamp',
124-
metric='avg:system.cpu.user.pct')
125-
.label('current hour')
126-
.title('CPU usage over time')
122+
.es(index=metricbeat-*,
123+
timefield='@timestamp',
124+
metric='avg:system.cpu.user.pct')
125+
.label('current hour')
126+
.title('CPU usage over time')
127127
----------------------------------
128128

129129
<1> `.lines()` changes the appearance of the chart lines. In this example, `.lines(fill=1,width=0.5)` sets the fill level to `1`, and the border width to `0.5`.
@@ -169,7 +169,20 @@ Change the position and style of the legend:
169169

170170
[source,text]
171171
----------------------------------
172-
.es(offset=-1h,index=metricbeat-*, timefield='@timestamp', metric='avg:system.cpu.user.pct').label('last hour').lines(fill=1,width=0.5).color(gray), .es(index=metricbeat-*, timefield='@timestamp', metric='avg:system.cpu.user.pct').label('current hour').title('CPU usage over time').color(#1E90FF).legend(columns=2, position=nw) <1>
172+
.es(offset=-1h,
173+
index=metricbeat-*,
174+
timefield='@timestamp',
175+
metric='avg:system.cpu.user.pct')
176+
.label('last hour')
177+
.lines(fill=1,width=0.5)
178+
.color(gray),
179+
.es(index=metricbeat-*,
180+
timefield='@timestamp',
181+
metric='avg:system.cpu.user.pct')
182+
.label('current hour')
183+
.title('CPU usage over time')
184+
.color(#1E90FF)
185+
.legend(columns=2, position=nw) <1>
173186
----------------------------------
174187

175188
<1> `.legend()` sets the position and style of the legend. In this example, `.legend(columns=2, position=nw)` places the legend in the north west position of the visualization with two columns.
@@ -192,7 +205,9 @@ To start tracking the inbound and outbound network traffic, enter the following
192205

193206
[source,text]
194207
----------------------------------
195-
.es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.in.bytes)
208+
.es(index=metricbeat*,
209+
timefield=@timestamp,
210+
metric=max:system.network.in.bytes)
196211
----------------------------------
197212

198213
[role="screenshot"]
@@ -207,7 +222,10 @@ Change how the data is displayed so that you can easily monitor the inbound traf
207222

208223
[source,text]
209224
----------------------------------
210-
.es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.in.bytes).derivative() <1>
225+
.es(index=metricbeat*,
226+
timefield=@timestamp,
227+
metric=max:system.network.in.bytes)
228+
.derivative() <1>
211229
----------------------------------
212230

213231
<1> `.derivative` plots the change in values over time.
@@ -220,7 +238,15 @@ Add a similar calculation for outbound traffic:
220238

221239
[source,text]
222240
----------------------------------
223-
.es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.in.bytes).derivative(), .es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.out.bytes).derivative().multiply(-1) <1>
241+
.es(index=metricbeat*,
242+
timefield=@timestamp,
243+
metric=max:system.network.in.bytes)
244+
.derivative(),
245+
.es(index=metricbeat*,
246+
timefield=@timestamp,
247+
metric=max:system.network.out.bytes)
248+
.derivative()
249+
.multiply(-1) <1>
224250
----------------------------------
225251

226252
<1> `.multiply()` multiplies the data series by a number, the result of a data series, or a list of data series. For this example, `.multiply(-1)` converts the outbound network traffic to a negative value since the outbound network traffic is leaving your machine.
@@ -237,7 +263,17 @@ To make the visualization easier to analyze, change the data metric from bytes t
237263

238264
[source,text]
239265
----------------------------------
240-
.es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.in.bytes).derivative().divide(1048576), .es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.out.bytes).derivative().multiply(-1).divide(1048576) <1>
266+
.es(index=metricbeat*,
267+
timefield=@timestamp,
268+
metric=max:system.network.in.bytes)
269+
.derivative()
270+
.divide(1048576),
271+
.es(index=metricbeat*,
272+
timefield=@timestamp,
273+
metric=max:system.network.out.bytes)
274+
.derivative()
275+
.multiply(-1)
276+
.divide(1048576) <1>
241277
----------------------------------
242278

243279
<1> `.divide()` accepts the same input as `.multiply()`, then divides the data series by the defined divisor.
@@ -271,8 +307,8 @@ Customize and format the visualization using functions:
271307
.divide(1048576)
272308
.lines(fill=2, width=1) <3>
273309
.color(blue) <4>
274-
.label("Outbound traffic")
275-
.legend(columns=2, position=nw) <5>
310+
.label("Outbound traffic")
311+
.legend(columns=2, position=nw) <5>
276312
----------------------------------
277313

278314
<1> `.label()` adds custom labels to the visualization.
@@ -309,7 +345,9 @@ To chart the maximum value of `system.memory.actual.used.bytes`, enter the follo
309345

310346
[source,text]
311347
----------------------------------
312-
.es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes')
348+
.es(index=metricbeat-*,
349+
timefield='@timestamp',
350+
metric='max:system.memory.actual.used.bytes')
313351
----------------------------------
314352

315353
[role="screenshot"]
@@ -338,17 +376,17 @@ To track the amount of memory used, create two thresholds:
338376
null)
339377
.label('warning')
340378
.color('#FFCC11'),
341-
.es(index=metricbeat-*,
342-
timefield='@timestamp',
343-
metric='max:system.memory.actual.used.bytes')
344-
.if(gt,
345-
11375000000,
346-
.es(index=metricbeat-*,
347-
timefield='@timestamp',
348-
metric='max:system.memory.actual.used.bytes'),
349-
null)
350-
.label('severe')
351-
.color('red')
379+
.es(index=metricbeat-*,
380+
timefield='@timestamp',
381+
metric='max:system.memory.actual.used.bytes')
382+
.if(gt,
383+
11375000000,
384+
.es(index=metricbeat-*,
385+
timefield='@timestamp',
386+
metric='max:system.memory.actual.used.bytes'),
387+
null)
388+
.label('severe')
389+
.color('red')
352390
----------------------------------
353391

354392
<1> Timelion conditional logic for the _greater than_ operator. In this example, the warning threshold is 11.3GB (`11300000000`), and the severe threshold is 11.375GB (`11375000000`). If the threshold values are too high or low for your machine, adjust the values accordingly.
@@ -366,7 +404,33 @@ To determine the trend, create a new data series:
366404

367405
[source,text]
368406
----------------------------------
369-
.es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes'), .es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes').if(gt,11300000000,.es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes'),null).label('warning').color('#FFCC11'), .es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes').if(gt,11375000000,.es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes'),null).label('severe').color('red'), .es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes').mvavg(10) <1>
407+
.es(index=metricbeat-*,
408+
timefield='@timestamp',
409+
metric='max:system.memory.actual.used.bytes'),
410+
.es(index=metricbeat-*,
411+
timefield='@timestamp',
412+
metric='max:system.memory.actual.used.bytes')
413+
.if(gt,11300000000,
414+
.es(index=metricbeat-*,
415+
timefield='@timestamp',
416+
metric='max:system.memory.actual.used.bytes'),
417+
null)
418+
.label('warning')
419+
.color('#FFCC11'),
420+
.es(index=metricbeat-*,
421+
timefield='@timestamp',
422+
metric='max:system.memory.actual.used.bytes')
423+
.if(gt,11375000000,
424+
.es(index=metricbeat-*,
425+
timefield='@timestamp',
426+
metric='max:system.memory.actual.used.bytes'),
427+
null).
428+
label('severe')
429+
.color('red'),
430+
.es(index=metricbeat-*,
431+
timefield='@timestamp',
432+
metric='max:system.memory.actual.used.bytes')
433+
.mvavg(10) <1>
370434
----------------------------------
371435

372436
<1> `mvavg()` calculates the moving average over a specified period of time. In this example, `.mvavg(10)` creates a moving average with a window of 10 data points.
@@ -396,30 +460,30 @@ Customize and format the visualization using functions:
396460
.es(index=metricbeat-*,
397461
timefield='@timestamp',
398462
metric='max:system.memory.actual.used.bytes'),
399-
null)
400-
.label('warning')
401-
.color('#FFCC11') <3>
402-
.lines(width=5), <4>
403-
.es(index=metricbeat-*,
404-
timefield='@timestamp',
405-
metric='max:system.memory.actual.used.bytes')
406-
.if(gt,
407-
11375000000,
408-
.es(index=metricbeat-*,
409-
timefield='@timestamp',
410-
metric='max:system.memory.actual.used.bytes'),
411-
null)
412-
.label('severe')
413-
.color('red')
414-
.lines(width=5),
463+
null)
464+
.label('warning')
465+
.color('#FFCC11') <3>
466+
.lines(width=5), <4>
467+
.es(index=metricbeat-*,
468+
timefield='@timestamp',
469+
metric='max:system.memory.actual.used.bytes')
470+
.if(gt,
471+
11375000000,
415472
.es(index=metricbeat-*,
416473
timefield='@timestamp',
417-
metric='max:system.memory.actual.used.bytes')
418-
.mvavg(10)
419-
.label('mvavg')
420-
.lines(width=2)
421-
.color(#5E5E5E)
422-
.legend(columns=4, position=nw) <5>
474+
metric='max:system.memory.actual.used.bytes'),
475+
null)
476+
.label('severe')
477+
.color('red')
478+
.lines(width=5),
479+
.es(index=metricbeat-*,
480+
timefield='@timestamp',
481+
metric='max:system.memory.actual.used.bytes')
482+
.mvavg(10)
483+
.label('mvavg')
484+
.lines(width=2)
485+
.color(#5E5E5E)
486+
.legend(columns=4, position=nw) <5>
423487
----------------------------------
424488

425489
<1> `.label()` adds custom labels to the visualization.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@
293293
"@elastic/eslint-plugin-eui": "0.0.2",
294294
"@elastic/github-checks-reporter": "0.0.20b3",
295295
"@elastic/makelogs": "^5.0.1",
296+
"@elastic/static-fs": "1.0.1",
296297
"@kbn/dev-utils": "1.0.0",
297298
"@kbn/es": "1.0.0",
298299
"@kbn/eslint-import-resolver-kibana": "2.0.0",

scripts/kibana.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
* under the License.
1818
*/
1919

20-
require('../src/apm')(process.env.ELASTIC_APM_PROXY_SERVICE_NAME || 'kibana-proxy');
2120
require('../src/setup_node_env');
21+
require('../src/apm')(process.env.ELASTIC_APM_PROXY_SERVICE_NAME || 'kibana-proxy');
2222
require('../src/cli/cli');

src/cli/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
* under the License.
1818
*/
1919

20-
require('../apm')();
2120
require('../setup_node_env');
21+
require('../apm')();
2222
require('./cli');

src/dev/build/build_distributables.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
CreatePackageJsonTask,
4141
CreateReadmeTask,
4242
CreateRpmPackageTask,
43+
CreateStaticFsWithNodeModulesTask,
4344
DownloadNodeBuildsTask,
4445
ExtractNodeBuildsTask,
4546
InstallDependenciesTask,
@@ -126,6 +127,7 @@ export async function buildDistributables(options) {
126127
await run(CleanTypescriptTask);
127128
await run(CleanExtraFilesFromModulesTask);
128129
await run(CleanEmptyFoldersTask);
130+
await run(CreateStaticFsWithNodeModulesTask);
129131

130132
/**
131133
* copy generic build outputs into platform-specific build

0 commit comments

Comments
 (0)