Skip to content

Commit 2024d25

Browse files
committed
Merge branch 'master' into alerting/refresh-on-deletion
* master: (154 commits) [ML] Fix initial plugin's bundle size (elastic#74047) [Ingest Manager] prevent crash on unhandled rejection from setupIngestManager (elastic#74300) [Logs UI] Correct trial period duration in anomaly splash screen (elastic#74249) [Discover] Inline noWhiteSpace function (elastic#74331) [DOCS] Add Observability topic (elastic#73041) skip flaky suite (elastic#74327) [Security Solution][Detections] Fixes Severity Override not matching for Elastic Endpoint Security rule (elastic#74317) [Security Solution][Exceptions] - Fixes exceptions builder nested deletion issue and adds unit tests (elastic#74250) Fixed Alert details does not update page title and breadcrumb (elastic#74214) [src/dev/build] build Kibana Platform bundles from source (elastic#73591) [Reporting] Shorten asset path to help CLI FS Watcher (elastic#74185) Fix TMS not loaded in legacy maps (elastic#73570) [Security Solution] styling for notes' panel (elastic#74274) [Security Solution][Tech Debt] cleans up ts-ignore issues and some smaller linter issues (elastic#74268) Make the actions plugin support generics (elastic#71439) [Security Solution] Keep original note creator (elastic#74203) [CI] Fix xpack kibana build dir in xpack visual regression script [CI] Fix baseline_capture job by adding parallel process number back [Monitoring] Ensure setup mode works on cloud but only for alerts (elastic#73127) [Maps] Custom color ramps should show correctly on the map for mvt layers (elastic#74169) ...
2 parents 61e75ec + 8231b0c commit 2024d25

File tree

1,462 files changed

+28867
-12358
lines changed

Some content is hidden

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

1,462 files changed

+28867
-12358
lines changed

.ci/Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
2+
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts
3+
4+
ARG NODE_VERSION=10.21.0
5+
6+
FROM node:${NODE_VERSION} AS base
7+
8+
RUN apt-get update && \
9+
apt-get -y install xvfb gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 \
10+
libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 \
11+
libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 \
12+
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 \
13+
libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget openjdk-8-jre && \
14+
rm -rf /var/lib/apt/lists/*
15+
16+
RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
17+
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
18+
&& apt-get update \
19+
&& apt-get install -y rsync jq bsdtar google-chrome-stable \
20+
--no-install-recommends \
21+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
22+
23+
RUN LATEST_VAULT_RELEASE=$(curl -s https://api.github.com/repos/hashicorp/vault/tags | jq --raw-output .[0].name[1:]) \
24+
&& curl -L https://releases.hashicorp.com/vault/${LATEST_VAULT_RELEASE}/vault_${LATEST_VAULT_RELEASE}_linux_amd64.zip -o vault.zip \
25+
&& unzip vault.zip \
26+
&& rm vault.zip \
27+
&& chmod +x vault \
28+
&& mv vault /usr/local/bin/vault
29+
30+
RUN groupadd -r kibana && useradd -r -g kibana kibana && mkdir /home/kibana && chown kibana:kibana /home/kibana
31+
32+
COPY ./bash_standard_lib.sh /usr/local/bin/bash_standard_lib.sh
33+
RUN chmod +x /usr/local/bin/bash_standard_lib.sh
34+
35+
COPY ./runbld /usr/local/bin/runbld
36+
RUN chmod +x /usr/local/bin/runbld
37+
38+
USER kibana

.ci/Jenkinsfile_baseline_capture

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@ kibanaPipeline(timeoutMinutes: 120) {
77
githubCommitStatus.trackBuild(params.commit, 'kibana-ci-baseline') {
88
ciStats.trackBuild {
99
catchError {
10-
parallel([
11-
'oss-visualRegression': {
12-
workers.ci(name: 'oss-visualRegression', size: 's-highmem', ramDisk: true) {
13-
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')(1)
14-
}
15-
},
16-
'xpack-visualRegression': {
17-
workers.ci(name: 'xpack-visualRegression', size: 's-highmem', ramDisk: true) {
18-
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')(1)
19-
}
20-
},
21-
])
10+
withEnv([
11+
'CI_PARALLEL_PROCESS_NUMBER=1'
12+
]) {
13+
parallel([
14+
'oss-visualRegression': {
15+
workers.ci(name: 'oss-visualRegression', size: 's-highmem', ramDisk: true) {
16+
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')()
17+
}
18+
},
19+
'xpack-visualRegression': {
20+
workers.ci(name: 'xpack-visualRegression', size: 's-highmem', ramDisk: true) {
21+
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')()
22+
}
23+
},
24+
])
25+
}
2226
}
2327

2428
kibanaPipeline.sendMail()

.ci/pipeline-library/src/test/slackNotifications.groovy

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
99
super.setUp()
1010

1111
helper.registerAllowedMethod('slackSend', [Map.class], null)
12+
prop('buildState', loadScript("vars/buildState.groovy"))
1213
slackNotifications = loadScript('vars/slackNotifications.groovy')
1314
}
1415

@@ -25,13 +26,49 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
2526
}
2627

2728
@Test
28-
void 'sendFailedBuild() should call slackSend() with message'() {
29+
void 'sendFailedBuild() should call slackSend() with an in-progress message'() {
2930
mockFailureBuild()
3031

3132
slackNotifications.sendFailedBuild()
3233

3334
def args = fnMock('slackSend').args[0]
3435

36+
def expected = [
37+
channel: '#kibana-operations-alerts',
38+
username: 'Kibana Operations',
39+
iconEmoji: ':jenkins:',
40+
color: 'danger',
41+
message: ':hourglass_flowing_sand: elastic / kibana # master #1',
42+
]
43+
44+
expected.each {
45+
assertEquals(it.value.toString(), args[it.key].toString())
46+
}
47+
48+
assertEquals(
49+
":hourglass_flowing_sand: *<http://jenkins.localhost:8080/job/elastic+kibana+master/1/|elastic / kibana # master #1>*",
50+
args.blocks[0].text.text.toString()
51+
)
52+
53+
assertEquals(
54+
"*Failed Steps*\n• <http://jenkins.localhost:8080|Execute test task>",
55+
args.blocks[1].text.text.toString()
56+
)
57+
58+
assertEquals(
59+
"*Test Failures*\n• <https://localhost/|x-pack/test/functional/apps/fake/test·ts.Fake test &lt;Component&gt; should &amp; pass &amp;>",
60+
args.blocks[2].text.text.toString()
61+
)
62+
}
63+
64+
@Test
65+
void 'sendFailedBuild() should call slackSend() with message'() {
66+
mockFailureBuild()
67+
68+
slackNotifications.sendFailedBuild(isFinal: true)
69+
70+
def args = fnMock('slackSend').args[0]
71+
3572
def expected = [
3673
channel: '#kibana-operations-alerts',
3774
username: 'Kibana Operations',
@@ -65,7 +102,7 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
65102
mockFailureBuild()
66103
def counter = 0
67104
helper.registerAllowedMethod('slackSend', [Map.class], { ++counter > 1 })
68-
slackNotifications.sendFailedBuild()
105+
slackNotifications.sendFailedBuild(isFinal: true)
69106

70107
def args = fnMocks('slackSend')[1].args[0]
71108

@@ -88,6 +125,29 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
88125
)
89126
}
90127

128+
@Test
129+
void 'sendFailedBuild() should call slackSend() with a channel id and timestamp on second call'() {
130+
mockFailureBuild()
131+
helper.registerAllowedMethod('slackSend', [Map.class], { [ channelId: 'CHANNEL_ID', ts: 'TIMESTAMP' ] })
132+
slackNotifications.sendFailedBuild(isFinal: false)
133+
slackNotifications.sendFailedBuild(isFinal: true)
134+
135+
def args = fnMocks('slackSend')[1].args[0]
136+
137+
def expected = [
138+
channel: 'CHANNEL_ID',
139+
timestamp: 'TIMESTAMP',
140+
username: 'Kibana Operations',
141+
iconEmoji: ':jenkins:',
142+
color: 'danger',
143+
message: ':broken_heart: elastic / kibana # master #1',
144+
]
145+
146+
expected.each {
147+
assertEquals(it.value.toString(), args[it.key].toString())
148+
}
149+
}
150+
91151
@Test
92152
void 'getTestFailures() should truncate list of failures to 10'() {
93153
prop('testUtils', [

.ci/runbld_no_junit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
profiles:
44
- ".*": # Match any job
55
tests:
6-
junit-filename-pattern: "8d8bd494-d909-4e67-a052-7e8b5aaeb5e4" # A bogus path that should never exist
6+
junit-filename-pattern: false

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ module.exports = {
529529
'x-pack/test_utils/**/*',
530530
'x-pack/gulpfile.js',
531531
'x-pack/plugins/apm/public/utils/testHelpers.js',
532+
'x-pack/plugins/canvas/shareable_runtime/postcss.config.js',
532533
],
533534
rules: {
534535
'import/no-extraneous-dependencies': [

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ npm-debug.log*
4949
.tern-project
5050
.nyc_output
5151
.ci/pipeline-library/build/
52+
.ci/runbld
53+
.ci/bash_standard_lib.sh
5254
.gradle
5355

5456
# apm plugin

Jenkinsfile

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,18 @@ library 'kibana-pipeline-library'
44
kibanaLibrary.load()
55

66
kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true) {
7-
githubPr.withDefaultPrComments {
8-
ciStats.trackBuild {
9-
catchError {
10-
retryable.enable()
11-
parallel([
12-
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
13-
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
14-
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
15-
'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
16-
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
17-
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
18-
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
19-
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
20-
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
21-
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
22-
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
23-
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
24-
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
25-
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
26-
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
27-
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
28-
'oss-accessibility': kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh'),
29-
// 'oss-visualRegression': kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh'),
30-
]),
31-
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
32-
'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
33-
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
34-
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
35-
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
36-
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
37-
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
38-
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
39-
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
40-
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
41-
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
42-
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
43-
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
44-
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
45-
'xpack-securitySolutionCypress': { processNumber ->
46-
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/', 'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/', 'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx']) {
47-
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)
48-
}
49-
},
50-
51-
// 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'),
52-
]),
53-
])
7+
slackNotifications.onFailure(disabled: !params.NOTIFY_ON_FAILURE) {
8+
githubPr.withDefaultPrComments {
9+
ciStats.trackBuild {
10+
catchError {
11+
retryable.enable()
12+
kibanaPipeline.allCiTasks()
13+
}
5414
}
5515
}
5616
}
5717

5818
if (params.NOTIFY_ON_FAILURE) {
59-
slackNotifications.onFailure()
6019
kibanaPipeline.sendMail()
6120
}
6221
}
61.1 KB
Loading

docs/apm/machine-learning.asciidoc

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,61 @@
11
[role="xpack"]
22
[[machine-learning-integration]]
3-
=== integration
3+
=== Machine learning integration
44

55
++++
66
<titleabbrev>Integrate with machine learning</titleabbrev>
77
++++
88

9-
The Machine Learning integration initiates a new job predefined to calculate anomaly scores on APM transaction durations.
10-
Jobs can be created per transaction type, and are based on the service's average response time.
9+
The Machine learning integration initiates a new job predefined to calculate anomaly scores on APM transaction durations.
10+
With this integration, you can quickly pinpoint anomalous transactions and see the health of
11+
any upstream and downstream services.
1112

12-
After a machine learning job is created, results are shown in two places:
13+
Machine learning jobs are created per environment, and are based on a service's average response time.
14+
Because jobs are created at the environment level,
15+
you can add new services to your existing environments without the need for additional machine learning jobs.
1316

14-
The transaction duration graph will show the expected bounds and add an annotation when the anomaly score is 75 or above.
17+
After a machine learning job is created, results are shown in two places:
1518

19+
* The transaction duration chart will show the expected bounds and add an annotation when the anomaly score is 75 or above.
20+
+
1621
[role="screenshot"]
1722
image::apm/images/apm-ml-integration.png[Example view of anomaly scores on response times in the APM app]
1823

19-
Service maps will display a color-coded anomaly indicator based on the detected anomaly score.
20-
24+
* Service maps will display a color-coded anomaly indicator based on the detected anomaly score.
25+
+
2126
[role="screenshot"]
2227
image::apm/images/apm-service-map-anomaly.png[Example view of anomaly scores on service maps in the APM app]
2328

2429
[float]
2530
[[create-ml-integration]]
26-
=== Create a new machine learning job
31+
=== Enable anomaly detection
32+
33+
To enable machine learning anomaly detection:
34+
35+
. From the Services overview, Traces overview, or Service Map tab,
36+
select **Anomaly detection**.
37+
38+
. Click **Create ML Job**.
2739

28-
To enable machine learning anomaly detection, first choose a service to monitor.
29-
Then, select **Integrations** > **Enable ML anomaly detection** and click **Create job**.
40+
. Machine learning jobs are created at the environment level.
41+
Select all of the service environments that you want to enable anomaly detection in.
42+
Anomalies will surface for all services and transaction types within the selected environments.
43+
44+
. Click **Create Jobs**.
3045

3146
That's it! After a few minutes, the job will begin calculating results;
32-
it might take additional time for results to appear on your graph.
33-
Jobs can be managed in *Machine Learning jobs management*.
47+
it might take additional time for results to appear on your service maps.
48+
Existing jobs can be managed in *Machine Learning jobs management*.
3449

3550
APM specific anomaly detection wizards are also available for certain Agents.
3651
See the machine learning {ml-docs}/ootb-ml-jobs-apm.html[APM anomaly detection configurations] for more information.
52+
53+
[float]
54+
[[warning-ml-integration]]
55+
=== Anomaly detection warning
56+
57+
To make machine learning as easy as possible to set up,
58+
the APM app will warn you when filtered to an environment without a machine learning job.
59+
60+
[role="screenshot"]
61+
image::apm/images/apm-anomaly-alert.png[Example view of anomaly alert in the APM app]

docs/development/core/server/kibana-plugin-core-server.assistanceapiresponse.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## AssistanceAPIResponse interface
66

7+
> Warning: This API is now obsolete.
8+
>
9+
>
710
811
<b>Signature:</b>
912

0 commit comments

Comments
 (0)