Skip to content

Commit

Permalink
Merge branch 'master' into apm-service-maps-generate-data-storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Jun 11, 2020
2 parents ed0ce31 + 6ec3c23 commit bc6da8b
Show file tree
Hide file tree
Showing 455 changed files with 8,210 additions and 3,770 deletions.
33 changes: 28 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,12 @@ module.exports = {
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
},
{
target: ['(src|x-pack)/plugins/*/public/**/*'],
from: ['(src|x-pack)/plugins/*/server/**/*'],
errorMessage: `Public code can not import from server, use a common directory.`,
target: [
'(src|x-pack)/plugins/*/server/**/*',
'!x-pack/plugins/apm/**/*', // https://github.com/elastic/kibana/issues/67210
],
from: ['(src|x-pack)/plugins/*/public/**/*'],
errorMessage: `Server code can not import from public, use a common directory.`,
},
{
target: ['(src|x-pack)/plugins/*/common/**/*'],
Expand Down Expand Up @@ -589,8 +592,11 @@ module.exports = {
* Security Solution overrides
*/
{
// front end typescript and javascript files only
files: ['x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}'],
// front end and common typescript and javascript files only
files: [
'x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}',
'x-pack/plugins/security_solution/common/**/*.{js,ts,tsx}',
],
rules: {
'import/no-nodejs-modules': 'error',
'no-restricted-imports': [
Expand Down Expand Up @@ -766,6 +772,23 @@ module.exports = {
/**
* Lists overrides
*/
{
// front end and common typescript and javascript files only
files: [
'x-pack/plugins/lists/public/**/*.{js,ts,tsx}',
'x-pack/plugins/lists/common/**/*.{js,ts,tsx}',
],
rules: {
'import/no-nodejs-modules': 'error',
'no-restricted-imports': [
'error',
{
// prevents UI code from importing server side code and then webpack including it when doing builds
patterns: ['**/server/*'],
},
],
},
},
{
// typescript and javascript for front and back end
files: ['x-pack/plugins/lists/**/*.{js,ts,tsx}'],
Expand Down
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@
/x-pack/plugins/endpoint/ @elastic/endpoint-app-team @elastic/siem
/x-pack/test/api_integration/apis/endpoint/ @elastic/endpoint-app-team @elastic/siem
/x-pack/test/endpoint_api_integration_no_ingest/ @elastic/endpoint-app-team @elastic/siem
/x-pack/test/functional_endpoint/ @elastic/endpoint-app-team @elastic/siem
/x-pack/test/functional_endpoint_ingest_failure/ @elastic/endpoint-app-team @elastic/siem
/x-pack/test/security_solution_endpoint/ @elastic/endpoint-app-team @elastic/siem
/x-pack/test/functional/es_archives/endpoint/ @elastic/endpoint-app-team @elastic/siem
/x-pack/test/plugin_functional/plugins/resolver_test/ @elastic/endpoint-app-team @elastic/siem
/x-pack/test/plugin_functional/test_suites/resolver/ @elastic/endpoint-app-team @elastic/siem
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.es
.DS_Store
.node_binaries
.native_modules
node_modules
!/src/dev/npm/integration_tests/__fixtures__/fixture1/node_modules
!/src/dev/notice/__fixtures__/node_modules
Expand Down
95 changes: 70 additions & 25 deletions docs/apm/api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,39 @@ Some APM app features are provided via a REST API:
[[apm-api-example]]
=== Using the APIs

Users interacting with APM APIs must have <<apm-app-api-user,sufficient privileges>>.
In addition, there are request headers to be aware of, like `kbn-xsrf: true`, and `Content-Type: applicaton/json`.
// The following content is reused throughout the API docs
// tag::using-the-APIs[]
Interact with APM APIs using cURL or another API tool.
All APM APIs are Kibana APIs, not Elasticsearch APIs;
because of this, the Kibana dev tools console cannot be used to interact with APM APIs.

For all APM APIs, you must use a request header.
Supported headers are `Authorization`, `kbn-xsrf`, and `Content-Type`.

`Authorization: ApiKey {credentials}`::
Kibana supports token-based authentication with the Elasticsearch API key service.
The API key returned by the {ref}/security-api-create-api-key.html[Elasticsearch create API key API]
can be used by sending a request with an `Authorization` header that has a value of `ApiKey` followed by the `{credentials}`,
where `{credentials}` is the base64 encoding of `id` and `api_key` joined by a colon.
+
Alternatively, you can create a user and use their username and password to authenticate API access: `-u $USER:$PASSWORD`.
+
Whether using `Authorization: ApiKey {credentials}`, or `-u $USER:$PASSWORD`,
users interacting with APM APIs must have <<apm-app-api-user,sufficient privileges>>.

`kbn-xsrf: true`::
By default, you must use `kbn-xsrf` for all API calls, except in the following scenarios:

* The API endpoint uses the `GET` or `HEAD` operations
* The path is whitelisted using the <<settings, `server.xsrf.whitelist`>> setting
* XSRF protections are disabled using the `server.xsrf.disableProtection` setting

`Content-Type: application/json`::
Applicable only when you send a payload in the API request.
{kib} API requests and responses use JSON.
Typically, if you include the `kbn-xsrf` header, you must also include the `Content-Type` header.
// end::using-the-APIs[]

Here's an example CURL request that adds an annotation to the APM app:

[source,curl]
Expand All @@ -38,9 +69,6 @@ curl -X POST \
}'
----

The Kibana <<api,REST API reference>> provides additional information on how to use Kibana APIs,
required request headers, and token-based authentication options.

////
*******************************************************
////
Expand All @@ -59,7 +87,15 @@ The following Agent configuration APIs are available:
* <<apm-list-config>> to list all Agent configurations.
* <<apm-search-config>> to search for an Agent configuration.

See <<apm-app-api-config-manager>> for information on the privileges required to use this API endpoint.
[float]
[[use-agent-config-api]]
==== How to use APM APIs

.Expand for required headers, privileges, and usage details
[%collapsible%closed]
======
include::api.asciidoc[tag=using-the-APIs]
======

////
*******************************************************
Expand Down Expand Up @@ -100,7 +136,7 @@ See <<apm-app-api-config-manager>> for information on the privileges required to
[[apm-update-config-example]]
===== Example

[source,console]
[source,curl]
--------------------------------------------------
PUT /api/apm/settings/agent-configuration
{
Expand Down Expand Up @@ -150,7 +186,7 @@ PUT /api/apm/settings/agent-configuration
[[apm-delete-config-example]]
===== Example

[source,console]
[source,curl]
--------------------------------------------------
DELETE /api/apm/settings/agent-configuration
{
Expand Down Expand Up @@ -228,7 +264,7 @@ DELETE /api/apm/settings/agent-configuration
[[apm-list-config-example]]
===== Example

[source,console]
[source,curl]
--------------------------------------------------
GET /api/apm/settings/agent-configuration
--------------------------------------------------
Expand Down Expand Up @@ -293,7 +329,7 @@ GET /api/apm/settings/agent-configuration
[[apm-search-config-example]]
===== Example

[source,console]
[source,curl]
--------------------------------------------------
POST /api/apm/settings/agent-configuration/search
{
Expand All @@ -317,17 +353,25 @@ POST /api/apm/settings/agent-configuration/search
The Annotation API allows you to annotate visualizations in the APM app with significant events, like deployments,
allowing you to easily see how these events are impacting the performance of your existing applications.

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`.

The following APIs are available:

* <<apm-annotation-create>> to create an annotation for APM.
// * <<obs-annotation-create>> POST /api/observability/annotation
// * <<obs-annotation-get>> GET /api/observability/annotation/:id
// * <<obs-annotation-delete>> DELETE /api/observability/annotation/:id

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`.
[float]
[[use-annotation-api]]
==== How to use APM APIs

See <<apm-app-api-annotation-manager>> for information on the privileges required to use this API endpoint.
.Expand for required headers, privileges, and usage details
[%collapsible%closed]
======
include::api.asciidoc[tag=using-the-APIs]
======

////
*******************************************************
Expand Down Expand Up @@ -374,19 +418,20 @@ While you can add additional tags, you cannot remove the `apm` tag.

The following example creates an annotation for a service named `opbeans-java`.

[source,console]
[source,curl]
--------------------------------------------------
POST /api/apm/services/opbeans-java/annotation
{
"@timestamp": "2020-05-08T10:31:30.452Z",
"service": {
"version": "1.2"
},
"message": "Deployment 1.2",
"tags": [
"elastic.co", "customer"
]
}
curl -X POST \
http://localhost:5601/api/apm/services/opbeans-java/annotation \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-H 'Authorization: Basic YhUlubWZhM0FDbnlQeE6WRtaW49FQmSGZ4RUWXdX' \
-d '{
"@timestamp": "2020-05-08T10:31:30.452Z",
"service": {
"version": "1.2"
},
"message": "Deployment 1.2"
}'
--------------------------------------------------

[[apm-annotation-config-body]]
Expand Down
2 changes: 1 addition & 1 deletion docs/apm/deployment-annotations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Alternatively, you can explicitly create deployment annotations with our annotat
The API can integrate into your CI/CD pipeline,
so that each time you deploy, a POST request is sent to the annotation API endpoint:

[source,console]
[source,curl]
----
curl -X POST \
http://localhost:5601/api/apm/services/${SERVICE_NAME}/annotation \ <1>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [expandShorthand](./kibana-plugin-plugins-data-public.expandshorthand.md)

## expandShorthand variable


<b>Signature:</b>

```typescript
expandShorthand: (sh: Record<string, ShorthandFieldMapObject>) => Record<string, FieldMappingSpec>
```
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-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) &gt; [\_deserialize](./kibana-plugin-plugins-data-public.fieldmappingspec._deserialize.md)

## FieldMappingSpec.\_deserialize property

<b>Signature:</b>

```typescript
_deserialize?: (mapping: string) => any | undefined;
```
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-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) &gt; [\_serialize](./kibana-plugin-plugins-data-public.fieldmappingspec._serialize.md)

## FieldMappingSpec.\_serialize property

<b>Signature:</b>

```typescript
_serialize?: (mapping: any) => string | undefined;
```
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-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md)

## FieldMappingSpec interface


<b>Signature:</b>

```typescript
export interface FieldMappingSpec
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [\_deserialize](./kibana-plugin-plugins-data-public.fieldmappingspec._deserialize.md) | <code>(mapping: string) =&gt; any &#124; undefined</code> | |
| [\_serialize](./kibana-plugin-plugins-data-public.fieldmappingspec._serialize.md) | <code>(mapping: any) =&gt; string &#124; undefined</code> | |
| [type](./kibana-plugin-plugins-data-public.fieldmappingspec.type.md) | <code>ES_FIELD_TYPES</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-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) &gt; [type](./kibana-plugin-plugins-data-public.fieldmappingspec.type.md)

## FieldMappingSpec.type property

<b>Signature:</b>

```typescript
type: ES_FIELD_TYPES;
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
getIndexPatternFieldListCreator: ({ fieldFormats, toastNotifications, }: FieldListDependencies) => CreateIndexPatternFieldList
getIndexPatternFieldListCreator: ({ fieldFormats, onNotification, }: FieldListDependencies) => CreateIndexPatternFieldList
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Constructs a new instance of the `IndexPattern` class
<b>Signature:</b>

```typescript
constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache);
constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache, fieldFormats: FieldFormatsStartCommon, onNotification: OnNotification, onError: OnError);
```

## Parameters
Expand All @@ -21,4 +21,7 @@ constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObj
| savedObjectsClient | <code>SavedObjectsClientContract</code> | |
| apiClient | <code>IIndexPatternsApiClient</code> | |
| patternCache | <code>PatternCache</code> | |
| fieldFormats | <code>FieldFormatsStartCommon</code> | |
| onNotification | <code>OnNotification</code> | |
| onError | <code>OnError</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export declare class IndexPattern implements IIndexPattern
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(id, getConfig, savedObjectsClient, apiClient, patternCache)](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the <code>IndexPattern</code> class |
| [(constructor)(id, getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError)](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the <code>IndexPattern</code> class |
## Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Constructs a new instance of the `Field` class
<b>Signature:</b>

```typescript
constructor(indexPattern: IndexPattern, spec: FieldSpec | Field, shortDotsEnable: boolean, { fieldFormats, toastNotifications }: FieldDependencies);
constructor(indexPattern: IIndexPattern, spec: FieldSpec | Field, shortDotsEnable: boolean, { fieldFormats, onNotification }: FieldDependencies);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| indexPattern | <code>IndexPattern</code> | |
| indexPattern | <code>IIndexPattern</code> | |
| spec | <code>FieldSpec &#124; Field</code> | |
| shortDotsEnable | <code>boolean</code> | |
| { fieldFormats, toastNotifications } | <code>FieldDependencies</code> | |
| { fieldFormats, onNotification } | <code>FieldDependencies</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
indexPattern?: IndexPattern;
indexPattern?: IIndexPattern;
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export declare class Field implements IFieldType
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(indexPattern, spec, shortDotsEnable, { fieldFormats, toastNotifications })](./kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md) | | Constructs a new instance of the <code>Field</code> class |
| [(constructor)(indexPattern, spec, shortDotsEnable, { fieldFormats, onNotification })](./kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md) | | Constructs a new instance of the <code>Field</code> class |
## Properties
Expand All @@ -28,7 +28,7 @@ export declare class Field implements IFieldType
| [esTypes](./kibana-plugin-plugins-data-public.indexpatternfield.estypes.md) | | <code>string[]</code> | |
| [filterable](./kibana-plugin-plugins-data-public.indexpatternfield.filterable.md) | | <code>boolean</code> | |
| [format](./kibana-plugin-plugins-data-public.indexpatternfield.format.md) | | <code>any</code> | |
| [indexPattern](./kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md) | | <code>IndexPattern</code> | |
| [indexPattern](./kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md) | | <code>IIndexPattern</code> | |
| [lang](./kibana-plugin-plugins-data-public.indexpatternfield.lang.md) | | <code>string</code> | |
| [name](./kibana-plugin-plugins-data-public.indexpatternfield.name.md) | | <code>string</code> | |
| [readFromDocValues](./kibana-plugin-plugins-data-public.indexpatternfield.readfromdocvalues.md) | | <code>boolean</code> | |
Expand Down
Loading

0 comments on commit bc6da8b

Please sign in to comment.