Skip to content

Commit

Permalink
Merge branch 'master' into lens/legend_stretch
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Jul 10, 2020
2 parents cac0950 + 12ec1be commit d6b709c
Show file tree
Hide file tree
Showing 3,074 changed files with 127,025 additions and 41,580 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .ci/Jenkinsfile_visual_baseline
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ kibanaPipeline(timeoutMinutes: 120) {
}

kibanaPipeline.sendMail()
slackNotifications.onFailure()
}
}
2 changes: 1 addition & 1 deletion .ci/packer_cache_for_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ echo "Creating bootstrap_cache archive"
# archive cacheable directories
mkdir -p "$HOME/.kibana/bootstrap_cache"
tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \
x-pack/plugins/reporting/.chromium \
.chromium \
.es \
.chromedriver \
.geckodriver;
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/*.js.snap
**/graphql/types.ts
/.es
/.chromium
/build
/built_assets
/config/apm.dev.js
Expand Down
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,18 @@ module.exports = {
},
},

/**
* Enterprise Search overrides
*/
{
files: ['x-pack/plugins/enterprise_search/**/*.{ts,tsx}'],
excludedFiles: ['x-pack/plugins/enterprise_search/**/*.{test,mock}.{ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'@typescript-eslint/no-explicit-any': 'error',
},
},

/**
* disable jsx-a11y for kbn-ui-framework
*/
Expand Down
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
/x-pack/plugins/licensing/ @elastic/kibana-platform
/x-pack/plugins/global_search/ @elastic/kibana-platform
/x-pack/plugins/cloud/ @elastic/kibana-platform
/x-pack/test/saved_objects_field_count/ @elastic/kibana-platform
/packages/kbn-config-schema/ @elastic/kibana-platform
/src/legacy/server/config/ @elastic/kibana-platform
/src/legacy/server/http/ @elastic/kibana-platform
Expand Down Expand Up @@ -200,6 +201,11 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
# Design
**/*.scss @elastic/kibana-design

# Enterprise Search
/x-pack/plugins/enterprise_search/ @elastic/app-search-frontend @elastic/workplace-search-frontend
/x-pack/test/functional_enterprise_search/ @elastic/app-search-frontend @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/**/*.scss @elastic/ent-search-design

# Elasticsearch UI
/src/plugins/dev_tools/ @elastic/es-ui
/src/plugins/console/ @elastic/es-ui
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.signing-config.json
.ackrc
/.es
/.chromium
.DS_Store
.node_binaries
.native_modules
Expand Down
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true)
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
// 'xpack-pageLoadMetrics': kibanaPipeline.functionalTestProcess('xpack-pageLoadMetrics', './test/scripts/jenkins_xpack_page_load_metrics.sh'),
'xpack-securitySolutionCypress': { processNumber ->
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) {
Expand Down
88 changes: 87 additions & 1 deletion docs/apm/api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Some APM app features are provided via a REST API:

* <<agent-config-api>>
* <<apm-annotation-api>>
* <<kibana-api,Kibana API>>

[float]
[[apm-api-example]]
Expand Down Expand Up @@ -355,6 +356,7 @@ allowing you to easily see how these events are impacting the performance of you

By default, annotations are stored in a newly created `observability-annotations` index.
The name of this index can be changed in your `config.yml` by editing `xpack.observability.annotations.index`.
If you change the default index name, you'll also need to <<apm-app-annotation-user-create,update your user privileges>> accordingly.

The following APIs are available:

Expand Down Expand Up @@ -396,7 +398,7 @@ include::api.asciidoc[tag=using-the-APIs]
[%collapsible%open]
======
`version` :::
(required, string) Name of service.
(required, string) Version of service.
`environment` :::
(optional, string) Environment of service.
Expand Down Expand Up @@ -467,3 +469,87 @@ curl -X POST \
}
}
--------------------------------------------------

////
*******************************************************
////

[[kibana-api]]
=== Kibana API

In addition to the APM specific API endpoints, Kibana provides its own <<api,REST API>>
which you can use to automate certain aspects of configuring and deploying Kibana.
An example is below.

[[api-create-apm-index-pattern]]
==== Customize the APM index pattern

As an alternative to updating <<apm-settings-in-kibana,`apm_oss.indexPattern`>> in your `kibana.yml` configuration file,
you can use Kibana's <<saved-objects-api-update,update object API>> to update the default APM index pattern on the fly.

The following example sets the default APM app index pattern to `some-other-pattern-*`:

[source,sh]
----
curl -X PUT "localhost:5601/api/saved_objects/index-pattern/apm_static_index_pattern_id" \ <1>
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-H 'Authorization: Basic ${YOUR_AUTH_TOKEN}' \
-d' {
"attributes": {
"title": "some-other-pattern-*", <2>
}
}'
----
<1> `apm_static_index_pattern_id` is the internal, hard-coded ID of the APM index pattern.
This value should not be changed
<2> Your custom index pattern matcher.

The API returns the following:

[source,json]
----
{
"id":"apm_static_index_pattern_id",
"type":"index-pattern",
"updated_at":"2020-07-06T22:55:59.555Z",
"version":"WzYsMV0=",
"attributes":{
"title":"some-other-pattern-*"
}
}
----

To view the new APM app index pattern, use the <<saved-objects-api-get,GET object API>>:

[source,sh]
----
curl -X GET "localhost:5601/api/saved_objects/index-pattern/apm_static_index_pattern_id" \ <1>
-H 'kbn-xsrf: true' \
-H 'Authorization: Basic ${YOUR_AUTH_TOKEN}'
----
<1> `apm_static_index_pattern_id` is the internal, hard-coded ID of the APM index pattern.

The API returns the following:

[source,json]
----
{
"id":"apm_static_index_pattern_id",
"type":"index-pattern",
"updated_at":"2020-07-06T22:55:59.555Z",
"version":"WzYsMV0=",
"attributes":{...}
"fieldFormatMap":"{...}
"fields":"[{...},{...},...]
"sourceFilters":"[{\"value\":\"sourcemap.sourcemap\"}]",
"timeFieldName":"@timestamp",
"title":"some-other-pattern-*"
},
...
}
----

// More examples will go here

More information on Kibana's API is available in <<api,REST API>>.
50 changes: 49 additions & 1 deletion docs/apm/apm-app-users.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

:beat_default_index_prefix: apm
:beat_kib_app: APM app
:annotation_index: `observability-annotations`
:annotation_index: observability-annotations

++++
<titleabbrev>Users and privileges</titleabbrev>
Expand Down Expand Up @@ -102,6 +102,54 @@ Here are two examples:
*********************************** ***********************************
////

[role="xpack"]
[[apm-app-annotation-user-create]]
=== APM app annotation user

++++
<titleabbrev>Create an annotation user</titleabbrev>
++++

NOTE: By default, the `apm_user` built-in role provides access to Observability annotations.
You only need to create an annotation user if the default annotation index
defined in <<apm-settings-kb,`xpack.observability.annotations.index`>> has been customized.

[[apm-app-annotation-user]]
==== Annotation user

View deployment annotations in the APM app.

. Create a new role, named something like `annotation_user`,
and assign the following privileges:
+
[options="header"]
|====
|Type | Privilege | Purpose

|Index
|`read` on +\{ANNOTATION_INDEX\}+^1^
|Read-only access to the observability annotation index

|Index
|`view_index_metadata` on +\{ANNOTATION_INDEX\}+^1^
|Read-only access to observability annotation index metadata
|====
+
^1^ +\{ANNOTATION_INDEX\}+ should be the index name you've defined in
<<apm-settings-kb,`xpack.observability.annotations.index`>>.

. Assign the `annotation_user` created previously, and the built-in roles necessary to create
a <<apm-app-reader-full,full>> or <<apm-app-reader-partial,partial>> APM reader to any users that need to view annotations in the APM app

[[apm-app-annotation-api]]
==== Annotation API

See <<apm-app-api-user>>.

////
*********************************** ***********************************
////

[role="xpack"]
[[apm-app-central-config-user]]
=== APM app central config user
Expand Down
3 changes: 2 additions & 1 deletion docs/apm/set-up.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ simply click *Load Kibana objects* at the bottom of the Setup Instructions.
[role="screenshot"]
image::apm/images/apm-index-pattern.png[Setup index pattern for APM in Kibana]

To use a custom index pattern, see <<apm-settings-in-kibana>>.
TIP: To use a custom index pattern,
adjust Kibana's <<apm-settings-in-kibana,settings>> or use the <<api-create-apm-index-pattern,Kibana API>>.

[float]
[[apm-getting-started-next]]
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions docs/developer/testing/interpreting-ci-failures.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Clicking the link next to the check in the conversation tab of a pull request wi

To view the results of a job execution in Jenkins, either click the link in the comment left by `@elasticmachine` or search for the `kibana-ci` check in the list at the bottom of the PR. This link will take you to the top-level page for the specific job execution that failed.

image::images/jenkins/job_view.png[]
image::images/job_view.png[]

1. *Git Changes:* the list of commits that were in this build which weren't in the previous build. For Pull Requests this list is calculated by comparing against the most recent Pull Request which was tested, it is not limited to build for this specific Pull Request, so it's not very useful.
2. *Test Results:* A link to the test results screen, and shortcuts to the failed tests. Functional tests capture and store the log output from each specific test, and make it visible at these links. For other test runners only the error message is visible and log output must be tracked down in the *Pipeline Steps*.
Expand All @@ -29,6 +29,6 @@ image::images/jenkins/job_view.png[]

To view the logs for a failed specific ciGroup, jest, mocha, type checkers, linters, etc., click on the *Pipeline Steps* link in from the Job page.

image::images/jenkins/pipeline_steps_view.png[]
image::images/pipeline_steps_view.png[]

Scroll down the page until you find a failed step *(1)*, and then look up a few lines for the `Branch:` step to see which specific job this is. If this is the job you're looking for click the little terminal icon next to the failed step *(1)* to view the logs for that specific step in the Pipeline.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AuditableEvent](./kibana-plugin-core-server.auditableevent.md)

## AuditableEvent interface

Event to audit.

<b>Signature:</b>

```typescript
export interface AuditableEvent
```

## Remarks

Not a complete interface.

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [message](./kibana-plugin-core-server.auditableevent.message.md) | <code>string</code> | |
| [type](./kibana-plugin-core-server.auditableevent.type.md) | <code>string</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AuditableEvent](./kibana-plugin-core-server.auditableevent.md) &gt; [message](./kibana-plugin-core-server.auditableevent.message.md)

## AuditableEvent.message property

<b>Signature:</b>

```typescript
message: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AuditableEvent](./kibana-plugin-core-server.auditableevent.md) &gt; [type](./kibana-plugin-core-server.auditableevent.type.md)

## AuditableEvent.type property

<b>Signature:</b>

```typescript
type: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Auditor](./kibana-plugin-core-server.auditor.md) &gt; [add](./kibana-plugin-core-server.auditor.add.md)

## Auditor.add() method

Add a record to audit log. Service attaches to a log record: - metadata about an end-user initiating an operation - scope name, if presents

<b>Signature:</b>

```typescript
add(event: AuditableEvent): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| event | <code>AuditableEvent</code> | |

<b>Returns:</b>

`void`

## Example

How to add a record in audit log:

```typescript
router.get({ path: '/my_endpoint', validate: false }, async (context, request, response) => {
context.core.auditor.withAuditScope('my_plugin_operation');
const value = await context.core.elasticsearch.legacy.client.callAsCurrentUser('...');
context.core.add({ type: 'operation.type', message: 'perform an operation in ... endpoint' });

```
21 changes: 21 additions & 0 deletions docs/development/core/server/kibana-plugin-core-server.auditor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Auditor](./kibana-plugin-core-server.auditor.md)

## Auditor interface

Provides methods to log user actions and access events.

<b>Signature:</b>

```typescript
export interface Auditor
```

## Methods

| Method | Description |
| --- | --- |
| [add(event)](./kibana-plugin-core-server.auditor.add.md) | Add a record to audit log. Service attaches to a log record: - metadata about an end-user initiating an operation - scope name, if presents |
| [withAuditScope(name)](./kibana-plugin-core-server.auditor.withauditscope.md) | Add a high-level scope name for logged events. It helps to identify the root cause of low-level events. |

Loading

0 comments on commit d6b709c

Please sign in to comment.