Skip to content

Commit

Permalink
Merge branch 'master' into pr/57821
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Mar 2, 2020
2 parents 919221b + 2998ec0 commit f9224cd
Show file tree
Hide file tree
Showing 81 changed files with 1,513 additions and 618 deletions.
5 changes: 5 additions & 0 deletions docs/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ This page has moved. Please see <<reporting-getting-started>>.

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

[role="exclude",id="add-sample-data"]
== Add sample data

This page has moved. Please see <<get-data-in>>.

[role="exclude",id="tilemap"]
== Coordinate map

Expand Down
70 changes: 40 additions & 30 deletions docs/user/getting-started.asciidoc
Original file line number Diff line number Diff line change
@@ -1,54 +1,65 @@
[[getting-started]]
= Getting Started
= Get started

[partintro]
--

You’re new to Kibana and want to give it a try. {kib} has sample data sets and
tutorials to help you get started.
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.

[float]
=== Sample data
[[cloud-set-up]]
== Set up on Cloud

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

[float]
. Log into the link:https://cloud.elastic.co/[Elasticsearch Service Console].
If you need an account, register for a link:https://www.elastic.co/cloud/elasticsearch-service/signup[free 14-day trial].

. Click *Create deployment*, then give your deployment a name.

=== Add data tutorials
{kib} has built-in *Add Data* tutorials to help you set up
data flows in the Elastic Stack. These tutorials are available
from the Kibana home page. In *Add Data to Kibana*, find the data type
you’re interested in, and click its button to view a list of available tutorials.
. To use the default options, click *Create deployment*. You can modify the other deployment options, but the default options are great to get started.

Be sure to copy down the password for the `elastic` user and Cloud ID information. You'll need that later.

[float]
=== Hands-on experience
[[get-data-in]]
== Get data into {kib}

The easiest way to get data into {kib} is to add a sample data set.

{kib} has several sample data sets that you can use before loading your own data:

* *Sample eCommerce orders* includes visualizations for tracking product-related information,
such as cost, revenue, and price.

* *Sample flight data* includes visualizations for monitoring flight routes.

The following tutorials walk you through searching, analyzing,
and visualizing data.
* *Sample web logs* includes visualizations for monitoring website traffic.

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

* <<tutorial-build-dashboard, Build your own dashboard>>. You'll manually load a data set and build
your own visualizations and dashboard.
. Go to the {kib} home page.

. Click *Load a data set and a {kib} dashboard*.

. Click *View data* and view the prepackaged dashboards, maps, and more.

[role="screenshot"]
image::images/add-sample-data.png[]

NOTE: The timestamps in the sample data sets are relative to when they are installed.
If you uninstall and reinstall a data set, the timestamps change to reflect the most recent installation.

[float]
=== Before you begin
[[getting-started-next-steps]]
== Next steps

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

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.)
* If you're ready to load an actual data set and build a dashboard, follow the <<tutorial-build-dashboard, build your own dashboard>> tutorial.

--

include::{kib-repo-dir}/getting-started/add-sample-data.asciidoc[]

include::{kib-repo-dir}/getting-started/tutorial-sample-data.asciidoc[]

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

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

4 changes: 2 additions & 2 deletions docs/user/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
include::introduction.asciidoc[]

include::getting-started.asciidoc[]

include::setup.asciidoc[]

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

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

include::getting-started.asciidoc[]

include::discover.asciidoc[]

include::visualize.asciidoc[]
Expand Down
13 changes: 13 additions & 0 deletions src/core/server/elasticsearch/retry_call_cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ describe('migrationsRetryCallCluster', () => {
});
});

it('retries ES API calls that rejects with snapshot_in_progress_exception', () => {
expect.assertions(1);
const callEsApi = jest.fn();
let i = 0;
callEsApi.mockImplementation(() => {
return i++ <= 2
? Promise.reject({ body: { error: { type: 'snapshot_in_progress_exception' } } })
: Promise.resolve('success');
});
const retried = migrationsRetryCallCluster(callEsApi, mockLogger.get('mock log'), 1);
return expect(retried('endpoint')).resolves.toMatchInlineSnapshot(`"success"`);
});

it('rejects when ES API calls reject with other errors', async () => {
expect.assertions(3);
const callEsApi = jest.fn();
Expand Down
13 changes: 3 additions & 10 deletions src/core/server/elasticsearch/retry_call_cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export function migrationsRetryCallCluster(
error instanceof esErrors.AuthenticationException ||
error instanceof esErrors.AuthorizationException ||
// @ts-ignore
error instanceof esErrors.Gone
error instanceof esErrors.Gone ||
error?.body?.error?.type === 'snapshot_in_progress_exception'
);
},
timer(delay),
Expand All @@ -85,15 +86,7 @@ export function migrationsRetryCallCluster(
*
* @param apiCaller
*/

// TODO: Replace with APICaller from './scoped_cluster_client' once #46668 is merged
export function retryCallCluster(
apiCaller: (
endpoint: string,
clientParams: Record<string, any>,
options?: CallAPIOptions
) => Promise<any>
) {
export function retryCallCluster(apiCaller: APICaller) {
return (endpoint: string, clientParams: Record<string, any> = {}, options?: CallAPIOptions) => {
return defer(() => apiCaller(endpoint, clientParams, options))
.pipe(
Expand Down
24 changes: 24 additions & 0 deletions src/core/utils/merge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

// eslint-disable-next-line max-classes-per-file
import { merge } from './merge';

describe('merge', () => {
Expand Down Expand Up @@ -62,6 +63,29 @@ describe('merge', () => {
expect(merge({ a: 0 }, { a: 1 }, {})).toEqual({ a: 1 });
});

test('does not merge class instances', () => {
class Folder {
constructor(public readonly path: string) {}
getPath() {
return this.path;
}
}
class File {
constructor(public readonly content: string) {}
getContent() {
return this.content;
}
}
const folder = new Folder('/etc');
const file = new File('yolo');

const result = merge({}, { content: folder }, { content: file });
expect(result).toStrictEqual({
content: file,
});
expect(result.content.getContent()).toBe('yolo');
});

test(`doesn't pollute prototypes`, () => {
merge({}, JSON.parse('{ "__proto__": { "foo": "bar" } }'));
merge({}, JSON.parse('{ "constructor": { "prototype": { "foo": "bar" } } }'));
Expand Down
4 changes: 2 additions & 2 deletions src/core/utils/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/

import { isPlainObject } from 'lodash';
/**
* Deeply merges two objects, omitting undefined values, and not deeply merging Arrays.
*
Expand Down Expand Up @@ -60,7 +60,7 @@ export function merge<TReturn extends Record<string, any>>(
) as TReturn;
}

const isMergable = (obj: any) => typeof obj === 'object' && obj !== null && !Array.isArray(obj);
const isMergable = (obj: any) => isPlainObject(obj);

const mergeObjects = <T extends Record<string, any>, U extends Record<string, any>>(
baseObj: T,
Expand Down
Loading

0 comments on commit f9224cd

Please sign in to comment.