Skip to content

Commit cee81e4

Browse files
Merge branch 'master' into fix/url-rewrites-in-dist-styles
2 parents a1fc03b + 2998ec0 commit cee81e4

118 files changed

Lines changed: 2020 additions & 5346 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.

docs/redirects.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ This page has moved. Please see <<reporting-getting-started>>.
5656

5757
This page has moved. Please see <<reporting-getting-started>>.
5858

59+
[role="exclude",id="add-sample-data"]
60+
== Add sample data
61+
62+
This page has moved. Please see <<get-data-in>>.
63+
5964
[role="exclude",id="tilemap"]
6065
== Coordinate map
6166

docs/user/getting-started.asciidoc

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,65 @@
11
[[getting-started]]
2-
= Getting Started
2+
= Get started
33

44
[partintro]
55
--
66

7-
You’re new to Kibana and want to give it a try. {kib} has sample data sets and
8-
tutorials to help you get started.
7+
Ready to try out {kib} and see what it can do? To quickest way to get started with {kib} is to set up on Cloud, then add a sample data set that helps you get a handle on the full range of {kib} features.
98

109
[float]
11-
=== Sample data
10+
[[cloud-set-up]]
11+
== Set up on Cloud
1212

13-
You can use the <<add-sample-data, sample data
14-
sets>> to take {kib} for a test ride without having
15-
to go through the process of loading data yourself. With one click,
16-
you can install a sample data set and start interacting with
17-
{kib} visualizations in seconds. You can access the sample data
18-
from the {kib} home page.
13+
To access {kib} in a single click, run our hosted Elasticsearch Service on Elastic Cloud.
1914

20-
[float]
15+
. Log into the link:https://cloud.elastic.co/[Elasticsearch Service Console].
16+
If you need an account, register for a link:https://www.elastic.co/cloud/elasticsearch-service/signup[free 14-day trial].
17+
18+
. Click *Create deployment*, then give your deployment a name.
2119

22-
=== Add data tutorials
23-
{kib} has built-in *Add Data* tutorials to help you set up
24-
data flows in the Elastic Stack. These tutorials are available
25-
from the Kibana home page. In *Add Data to Kibana*, find the data type
26-
you’re interested in, and click its button to view a list of available tutorials.
20+
. To use the default options, click *Create deployment*. You can modify the other deployment options, but the default options are great to get started.
21+
22+
Be sure to copy down the password for the `elastic` user and Cloud ID information. You'll need that later.
2723

2824
[float]
29-
=== Hands-on experience
25+
[[get-data-in]]
26+
== Get data into {kib}
27+
28+
The easiest way to get data into {kib} is to add a sample data set.
29+
30+
{kib} has several sample data sets that you can use before loading your own data:
31+
32+
* *Sample eCommerce orders* includes visualizations for tracking product-related information,
33+
such as cost, revenue, and price.
34+
35+
* *Sample flight data* includes visualizations for monitoring flight routes.
3036

31-
The following tutorials walk you through searching, analyzing,
32-
and visualizing data.
37+
* *Sample web logs* includes visualizations for monitoring website traffic.
3338

34-
* <<tutorial-sample-data, Explore Kibana using sample data>>. You'll
35-
learn to filter and query data, edit visualizations, and interact with dashboards.
39+
To use the sample data sets:
3640

37-
* <<tutorial-build-dashboard, Build your own dashboard>>. You'll manually load a data set and build
38-
your own visualizations and dashboard.
41+
. Go to the {kib} home page.
42+
43+
. Click *Load a data set and a {kib} dashboard*.
44+
45+
. Click *View data* and view the prepackaged dashboards, maps, and more.
46+
47+
[role="screenshot"]
48+
image::images/add-sample-data.png[]
49+
50+
NOTE: The timestamps in the sample data sets are relative to when they are installed.
51+
If you uninstall and reinstall a data set, the timestamps change to reflect the most recent installation.
3952

4053
[float]
41-
=== Before you begin
54+
[[getting-started-next-steps]]
55+
== Next steps
4256

43-
Make sure you've <<install, installed Kibana>> and established
44-
a <<connect-to-elasticsearch, connection to Elasticsearch>>.
57+
* To get a hands-on experience creating visualizations, follow the <<tutorial-sample-data, add sample data>> tutorial.
4558

46-
If you are running our hosted Elasticsearch Service on Elastic Cloud, you access Kibana with a single click. (You can {ess-trial}[sign up for a free trial] and start exploring data in minutes.)
59+
* If you're ready to load an actual data set and build a dashboard, follow the <<tutorial-build-dashboard, build your own dashboard>> tutorial.
4760

4861
--
4962

50-
include::{kib-repo-dir}/getting-started/add-sample-data.asciidoc[]
51-
5263
include::{kib-repo-dir}/getting-started/tutorial-sample-data.asciidoc[]
5364

5465
include::{kib-repo-dir}/getting-started/tutorial-full-experience.asciidoc[]
@@ -60,4 +71,3 @@ include::{kib-repo-dir}/getting-started/tutorial-discovering.asciidoc[]
6071
include::{kib-repo-dir}/getting-started/tutorial-visualizing.asciidoc[]
6172

6273
include::{kib-repo-dir}/getting-started/tutorial-dashboard.asciidoc[]
63-

docs/user/index.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
include::introduction.asciidoc[]
22

3+
include::getting-started.asciidoc[]
4+
35
include::setup.asciidoc[]
46

57
include::monitoring/configuring-monitoring.asciidoc[]
68

79
include::security/securing-kibana.asciidoc[]
810

9-
include::getting-started.asciidoc[]
10-
1111
include::discover.asciidoc[]
1212

1313
include::visualize.asciidoc[]

src/cli/dev_ssl.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/cli/serve/serve.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import { getConfigPath } from '../../core/server/path';
2828
import { bootstrap } from '../../core/server';
2929
import { readKeystore } from './read_keystore';
3030

31-
import { DEV_SSL_CERT_PATH, DEV_SSL_KEY_PATH } from '../dev_ssl';
32-
3331
function canRequire(path) {
3432
try {
3533
require.resolve(path);
@@ -90,7 +88,7 @@ function applyConfigOverrides(rawConfig, opts, extraCliOptions) {
9088

9189
if (opts.ssl) {
9290
// @kbn/dev-utils is part of devDependencies
93-
const { CA_CERT_PATH } = require('@kbn/dev-utils');
91+
const { CA_CERT_PATH, KBN_KEY_PATH, KBN_CERT_PATH } = require('@kbn/dev-utils');
9492
const customElasticsearchHosts = opts.elasticsearch
9593
? opts.elasticsearch.split(',')
9694
: [].concat(get('elasticsearch.hosts') || []);
@@ -104,6 +102,7 @@ function applyConfigOverrides(rawConfig, opts, extraCliOptions) {
104102
ensureNotDefined('server.ssl.key');
105103
ensureNotDefined('server.ssl.keystore.path');
106104
ensureNotDefined('server.ssl.truststore.path');
105+
ensureNotDefined('server.ssl.certificateAuthorities');
107106
ensureNotDefined('elasticsearch.ssl.certificateAuthorities');
108107

109108
const elasticsearchHosts = (
@@ -121,10 +120,9 @@ function applyConfigOverrides(rawConfig, opts, extraCliOptions) {
121120
});
122121

123122
set('server.ssl.enabled', true);
124-
// TODO: change this cert/key to KBN_CERT_PATH and KBN_KEY_PATH from '@kbn/dev-utils'; will require some work to avoid breaking
125-
// functional tests. Once that is done, the existing test cert/key at DEV_SSL_CERT_PATH and DEV_SSL_KEY_PATH can be deleted.
126-
set('server.ssl.certificate', DEV_SSL_CERT_PATH);
127-
set('server.ssl.key', DEV_SSL_KEY_PATH);
123+
set('server.ssl.certificate', KBN_CERT_PATH);
124+
set('server.ssl.key', KBN_KEY_PATH);
125+
set('server.ssl.certificateAuthorities', CA_CERT_PATH);
128126
set('elasticsearch.hosts', elasticsearchHosts);
129127
set('elasticsearch.ssl.certificateAuthorities', CA_CERT_PATH);
130128
}

src/core/server/elasticsearch/elasticsearch_service.test.ts

Lines changed: 99 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ import { ElasticsearchService } from './elasticsearch_service';
3333
import { elasticsearchServiceMock } from './elasticsearch_service.mock';
3434
import { duration } from 'moment';
3535

36+
const delay = async (durationMs: number) =>
37+
await new Promise(resolve => setTimeout(resolve, durationMs));
38+
3639
let elasticsearchService: ElasticsearchService;
3740
const configService = configServiceMock.create();
3841
const deps = {
@@ -42,7 +45,7 @@ configService.atPath.mockReturnValue(
4245
new BehaviorSubject({
4346
hosts: ['http://1.2.3.4'],
4447
healthCheck: {
45-
delay: duration(2000),
48+
delay: duration(10),
4649
},
4750
ssl: {
4851
verificationMode: 'none',
@@ -125,21 +128,21 @@ describe('#setup', () => {
125128

126129
const config = MockClusterClient.mock.calls[0][0];
127130
expect(config).toMatchInlineSnapshot(`
128-
Object {
129-
"healthCheckDelay": "PT2S",
130-
"hosts": Array [
131-
"http://8.8.8.8",
132-
],
133-
"logQueries": true,
134-
"requestHeadersWhitelist": Array [
135-
undefined,
136-
],
137-
"ssl": Object {
138-
"certificate": "certificate-value",
139-
"verificationMode": "none",
140-
},
141-
}
142-
`);
131+
Object {
132+
"healthCheckDelay": "PT0.01S",
133+
"hosts": Array [
134+
"http://8.8.8.8",
135+
],
136+
"logQueries": true,
137+
"requestHeadersWhitelist": Array [
138+
undefined,
139+
],
140+
"ssl": Object {
141+
"certificate": "certificate-value",
142+
"verificationMode": "none",
143+
},
144+
}
145+
`);
143146
});
144147
it('falls back to elasticsearch config if custom config not passed', async () => {
145148
const setupContract = await elasticsearchService.setup(deps);
@@ -150,24 +153,24 @@ Object {
150153

151154
const config = MockClusterClient.mock.calls[0][0];
152155
expect(config).toMatchInlineSnapshot(`
153-
Object {
154-
"healthCheckDelay": "PT2S",
155-
"hosts": Array [
156-
"http://1.2.3.4",
157-
],
158-
"requestHeadersWhitelist": Array [
159-
undefined,
160-
],
161-
"ssl": Object {
162-
"alwaysPresentCertificate": undefined,
163-
"certificate": undefined,
164-
"certificateAuthorities": undefined,
165-
"key": undefined,
166-
"keyPassphrase": undefined,
167-
"verificationMode": "none",
168-
},
169-
}
170-
`);
156+
Object {
157+
"healthCheckDelay": "PT0.01S",
158+
"hosts": Array [
159+
"http://1.2.3.4",
160+
],
161+
"requestHeadersWhitelist": Array [
162+
undefined,
163+
],
164+
"ssl": Object {
165+
"alwaysPresentCertificate": undefined,
166+
"certificate": undefined,
167+
"certificateAuthorities": undefined,
168+
"key": undefined,
169+
"keyPassphrase": undefined,
170+
"verificationMode": "none",
171+
},
172+
}
173+
`);
171174
});
172175

173176
it('does not merge elasticsearch hosts if custom config overrides', async () => {
@@ -213,6 +216,45 @@ Object {
213216
`);
214217
});
215218
});
219+
220+
it('esNodeVersionCompatibility$ only starts polling when subscribed to', async done => {
221+
const mockAdminClusterClientInstance = elasticsearchServiceMock.createClusterClient();
222+
const mockDataClusterClientInstance = elasticsearchServiceMock.createClusterClient();
223+
MockClusterClient.mockImplementationOnce(
224+
() => mockAdminClusterClientInstance
225+
).mockImplementationOnce(() => mockDataClusterClientInstance);
226+
227+
mockAdminClusterClientInstance.callAsInternalUser.mockRejectedValue(new Error());
228+
229+
const setupContract = await elasticsearchService.setup(deps);
230+
await delay(10);
231+
232+
expect(mockAdminClusterClientInstance.callAsInternalUser).toHaveBeenCalledTimes(0);
233+
setupContract.esNodesCompatibility$.subscribe(() => {
234+
expect(mockAdminClusterClientInstance.callAsInternalUser).toHaveBeenCalledTimes(1);
235+
done();
236+
});
237+
});
238+
239+
it('esNodeVersionCompatibility$ stops polling when unsubscribed from', async done => {
240+
const mockAdminClusterClientInstance = elasticsearchServiceMock.createClusterClient();
241+
const mockDataClusterClientInstance = elasticsearchServiceMock.createClusterClient();
242+
MockClusterClient.mockImplementationOnce(
243+
() => mockAdminClusterClientInstance
244+
).mockImplementationOnce(() => mockDataClusterClientInstance);
245+
246+
mockAdminClusterClientInstance.callAsInternalUser.mockRejectedValue(new Error());
247+
248+
const setupContract = await elasticsearchService.setup(deps);
249+
250+
expect(mockAdminClusterClientInstance.callAsInternalUser).toHaveBeenCalledTimes(0);
251+
const sub = setupContract.esNodesCompatibility$.subscribe(async () => {
252+
sub.unsubscribe();
253+
await delay(100);
254+
expect(mockAdminClusterClientInstance.callAsInternalUser).toHaveBeenCalledTimes(1);
255+
done();
256+
});
257+
});
216258
});
217259

218260
describe('#stop', () => {
@@ -229,4 +271,27 @@ describe('#stop', () => {
229271
expect(mockAdminClusterClientInstance.close).toHaveBeenCalledTimes(1);
230272
expect(mockDataClusterClientInstance.close).toHaveBeenCalledTimes(1);
231273
});
274+
275+
it('stops pollEsNodeVersions even if there are active subscriptions', async done => {
276+
expect.assertions(2);
277+
const mockAdminClusterClientInstance = elasticsearchServiceMock.createCustomClusterClient();
278+
const mockDataClusterClientInstance = elasticsearchServiceMock.createCustomClusterClient();
279+
280+
MockClusterClient.mockImplementationOnce(
281+
() => mockAdminClusterClientInstance
282+
).mockImplementationOnce(() => mockDataClusterClientInstance);
283+
284+
mockAdminClusterClientInstance.callAsInternalUser.mockRejectedValue(new Error());
285+
286+
const setupContract = await elasticsearchService.setup(deps);
287+
288+
setupContract.esNodesCompatibility$.subscribe(async () => {
289+
expect(mockAdminClusterClientInstance.callAsInternalUser).toHaveBeenCalledTimes(1);
290+
291+
await elasticsearchService.stop();
292+
await delay(100);
293+
expect(mockAdminClusterClientInstance.callAsInternalUser).toHaveBeenCalledTimes(1);
294+
done();
295+
});
296+
});
232297
});

0 commit comments

Comments
 (0)