Skip to content

Commit 0660d44

Browse files
committed
Merge branch 'master' into saved-objects/scoped-client-with-extra-types
* master: [apm] Annotation API documentation (elastic#65963) [Uptime] Improve responsiveness details page (elastic#67034) skip flaky suite (elastic#66669) Revert "Integration of a static filesystem for the node_modules (elastic#47998)" (elastic#67124) Support api_integration/kibana/stats against remote hosts (elastic#53000) chore(NA): add module name mapper for src plugins on x-pack (elastic#67103) Change the error message on TSVB in order to be more user friendly (elastic#67090) [kbn/optimizer] poll parent process to avoid zombie processes (elastic#67059) [Visualize] Lazy load default editor, fix duplicated styles (elastic#66732) Bump styled-component dependencies (elastic#66611) Bump react-markdown dependencies (elastic#66615) Fix Core docs links (elastic#66977) Timelion graph is not refreshing content after searching or filtering (elastic#67023) Remove `--xpack.endpoint.enabled=true` from README.md file (elastic#67053) Move apm tutorial from apm plugin into apm_oss plugin (elastic#66432) [Logs UI] Restore call to `UsageCollector.countLogs` (elastic#67051) Remove unused license check result from LP Security plugin (elastic#66966)
2 parents b826313 + 203605e commit 0660d44

File tree

87 files changed

+2415
-2072
lines changed

Some content is hidden

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

87 files changed

+2415
-2072
lines changed

.i18nrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
"visTypeVislib": "src/plugins/vis_type_vislib",
5757
"visTypeXy": "src/plugins/vis_type_xy",
5858
"visualizations": "src/plugins/visualizations",
59-
"visualize": "src/plugins/visualize"
59+
"visualize": "src/plugins/visualize",
60+
"apmOss": "src/plugins/apm_oss"
6061
},
6162
"exclude": [
6263
"src/legacy/ui/ui_render/ui_render_mixin.js"

docs/apm/api.asciidoc

Lines changed: 146 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,45 @@
99
Some APM app features are provided via a REST API:
1010

1111
* <<agent-config-api>>
12-
13-
TIP: Kibana provides additional <<api,REST APIs>>,
14-
and general information on <<using-api,how to use APIs>>.
12+
* <<apm-annotation-api>>
13+
14+
Here's an example CURL request that adds an annotation to the APM app:
15+
16+
[source,curl]
17+
----
18+
curl -X POST \
19+
http://localhost:5601/api/apm/services/opbeans-java/annotation \
20+
-H 'Content-Type: application/json' \
21+
-H 'kbn-xsrf: true' \
22+
-H 'Authorization: Basic YhUlubWZhM0FDbnlQeE6WRtaW49FQmSGZ4RUWXdX' \
23+
-d '{
24+
"@timestamp": "2020-05-11T10:31:30.452Z",
25+
"service": {
26+
"version": "1.2"
27+
},
28+
"message": "Revert upgrade",
29+
"tags": [
30+
"elastic.co", "customer"
31+
]
32+
}'
33+
----
34+
35+
For more information, the Kibana <<api,REST API reference>> provides information on how to use Kibana APIs,
36+
like required request headers and authentication options.
37+
38+
// AGENT CONFIG API
39+
// GET --> Feature (APM) Read
40+
// CREATE/EDIT/DELETE --> Feature (APM) All
41+
42+
// ANNOTATION API
43+
// Feature (APM) All
44+
// Index: `observability-annotations`. Privileges: `create_index`, `create_doc`, `manage`, and `read`.
1545

1646
////
1747
*******************************************************
1848
////
1949

50+
[role="xpack"]
2051
[[agent-config-api]]
2152
=== Agent Configuration API
2253

@@ -274,6 +305,118 @@ POST /api/apm/settings/agent-configuration/search
274305
}
275306
--------------------------------------------------
276307

308+
////
309+
*******************************************************
310+
*******************************************************
311+
////
312+
313+
[role="xpack"]
314+
[[apm-annotation-api]]
315+
=== Annotation API
316+
317+
The Annotation API allows you to annotate visualizations in the APM app with significant events, like deployments,
318+
allowing you to easily see how these events are impacting the performance of your existing applications.
319+
320+
The following APIs are available:
321+
322+
* <<apm-annotation-create>> to create an annotation for APM.
323+
// * <<obs-annotation-create>> POST /api/observability/annotation
324+
// * <<obs-annotation-get>> GET /api/observability/annotation/:id
325+
// * <<obs-annotation-delete>> DELETE /api/observability/annotation/:id
326+
327+
By default, annotations are stored in a newly created `observability-annotations` index.
328+
The name of this index can be changed in your `config.yml` by editing `xpack.observability.annotations.index`.
329+
277330
////
278331
*******************************************************
279332
////
333+
334+
[[apm-annotation-create]]
335+
==== Create or update annotation
336+
337+
[[apm-annotation-config-req]]
338+
===== Request
339+
340+
`POST /api/apm/services/:serviceName/annotation`
341+
342+
[role="child_attributes"]
343+
[[apm-annotation-config-req-body]]
344+
===== Request body
345+
346+
`service`::
347+
(required, object) Service identifying the configuration to create or update.
348+
+
349+
.Properties of `service`
350+
[%collapsible%open]
351+
======
352+
`version` :::
353+
(required, string) Name of service.
354+
355+
`environment` :::
356+
(optional, string) Environment of service.
357+
======
358+
359+
`@timestamp`::
360+
(required, string) The date and time of the annotation. Must be in https://www.w3.org/TR/NOTE-datetime[ISO 8601] format.
361+
362+
`message`::
363+
(optional, string) The message displayed in the annotation. Defaults to `service.version`.
364+
365+
`tags`::
366+
(optional, array) Tags are used by the APM app to distinguish APM annotations from other annotations.
367+
Tags may have additional functionality in future releases. Defaults to `[apm]`.
368+
While you can add additional tags, you cannot remove the `apm` tag.
369+
370+
[[apm-annotation-config-example]]
371+
===== Example
372+
373+
The following example creates an annotation for a service named `opbeans-java`.
374+
375+
[source,console]
376+
--------------------------------------------------
377+
POST /api/apm/services/opbeans-java/annotation
378+
{
379+
"@timestamp": "2020-05-08T10:31:30.452Z",
380+
"service": {
381+
"version": "1.2"
382+
},
383+
"message": "Deployment 1.2",
384+
"tags": [
385+
"elastic.co", "customer"
386+
]
387+
}
388+
--------------------------------------------------
389+
390+
[[apm-annotation-config-body]]
391+
===== Response body
392+
393+
[source,js]
394+
--------------------------------------------------
395+
{
396+
"_index": "observability-annotations",
397+
"_id": "Lc9I93EBh6DbmkeV7nFX",
398+
"_version": 1,
399+
"_seq_no": 12,
400+
"_primary_term": 1,
401+
"found": true,
402+
"_source": {
403+
"message": "Deployment 1.2",
404+
"@timestamp": "2020-05-08T10:31:30.452Z",
405+
"service": {
406+
"version": "1.2",
407+
"name": "opbeans-java"
408+
},
409+
"tags": [
410+
"apm",
411+
"elastic.co",
412+
"customer"
413+
],
414+
"annotation": {
415+
"type": "deployment"
416+
},
417+
"event": {
418+
"created": "2020-05-09T02:34:43.937Z"
419+
}
420+
}
421+
}
422+
--------------------------------------------------

docs/apm/deployment-annotations.asciidoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33
=== Track deployments with annotations
44

55
++++
6-
<titleabbrev>Track deployments</titleabbrev>
6+
<titleabbrev>Track deployments with annotations</titleabbrev>
77
++++
88

99
For enhanced visibility into your deployments, we offer deployment annotations on all transaction charts.
1010
This feature automatically tags new deployments, so you can easily see if your deploy has increased response times
1111
for an end-user, or if the memory/CPU footprint of your application has changed.
1212
Being able to identify bad deployments quickly enables you to rollback and fix issues without causing costly outages.
1313

14-
Deployment annotations are automatically enabled, and appear when the `service.version` of your app changes.
14+
Deployment annotations are enabled by default, and can be created with the <<apm-annotation-api,annotation API>>.
15+
If there are no created annotations for the selected time period,
16+
the APM app will automatically annotate your data if the `service.version` of your application changes.
17+
18+
NOTE: If custom annotations have been created for the selected time period, any derived annotations, i.e., those created automatically when `service.version` changes, will not be shown.
1519

1620
[role="screenshot"]
1721
image::apm/images/apm-transaction-annotation.png[Example view of transactions annotation in the APM app in Kibana]
356 KB
Loading

docs/settings/apm-settings.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ Changing these settings may disable features of the APM App.
5252
| `xpack.apm.ui.maxTraceItems` {ess-icon}
5353
| Maximum number of child items displayed when viewing trace details. Defaults to `1000`.
5454

55+
| `xpack.observability.annotations.index`
56+
| Index name where Observability annotations are stored. Defaults to `observability-annotations`.
57+
5558
| `apm_oss.indexPattern` {ess-icon}
5659
| The index pattern used for integrations with Machine Learning and Query Bar.
5760
It must match all apm indices. Defaults to `apm-*`.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
"react-dom": "^16.12.0",
241241
"react-grid-layout": "^0.16.2",
242242
"react-input-range": "^1.3.0",
243-
"react-markdown": "^3.4.1",
243+
"react-markdown": "^4.3.1",
244244
"react-monaco-editor": "~0.27.0",
245245
"react-redux": "^7.1.3",
246246
"react-resize-detector": "^4.2.0",
@@ -298,7 +298,6 @@
298298
"@elastic/eslint-plugin-eui": "0.0.2",
299299
"@elastic/github-checks-reporter": "0.0.20b3",
300300
"@elastic/makelogs": "^5.0.1",
301-
"@elastic/static-fs": "1.0.2",
302301
"@kbn/dev-utils": "1.0.0",
303302
"@kbn/es": "1.0.0",
304303
"@kbn/eslint-import-resolver-kibana": "2.0.0",
@@ -387,7 +386,7 @@
387386
"@types/semver": "^5.5.0",
388387
"@types/sinon": "^7.0.13",
389388
"@types/strip-ansi": "^3.0.0",
390-
"@types/styled-components": "^4.4.2",
389+
"@types/styled-components": "^5.1.0",
391390
"@types/supertest": "^2.0.5",
392391
"@types/supertest-as-promised": "^2.0.38",
393392
"@types/testing-library__react": "^9.1.2",

packages/kbn-babel-preset/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@babel/preset-typescript": "^7.9.0",
1515
"babel-plugin-add-module-exports": "^1.0.2",
1616
"babel-plugin-filter-imports": "^3.0.0",
17-
"babel-plugin-styled-components": "^1.10.6",
17+
"babel-plugin-styled-components": "^1.10.7",
1818
"babel-plugin-transform-define": "^1.3.1",
1919
"babel-plugin-transform-imports": "^2.0.0"
2020
}

packages/kbn-optimizer/src/common/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export * from './bundle';
2121
export * from './bundle_cache';
2222
export * from './worker_config';
2323
export * from './worker_messages';
24+
export * from './parent_messages';
2425
export * from './compiler_messages';
2526
export * from './ts_helpers';
2627
export * from './rxjs_helpers';
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export interface ParentPongMsg {
21+
type: 'pong';
22+
}
23+
24+
export const isParentPong = (value: any): value is ParentPongMsg =>
25+
typeof value === 'object' && value && value.type === 'pong';
26+
27+
export class ParentMsgs {
28+
pong(): ParentPongMsg {
29+
return {
30+
type: 'pong',
31+
};
32+
}
33+
}

packages/kbn-optimizer/src/common/worker_messages.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ import {
2424
CompilerErrorMsg,
2525
} from './compiler_messages';
2626

27-
export type WorkerMsg =
27+
export type InternalWorkerMsg =
28+
| WorkerPingMsg
2829
| CompilerRunningMsg
2930
| CompilerIssueMsg
3031
| CompilerSuccessMsg
3132
| CompilerErrorMsg
3233
| WorkerErrorMsg;
3334

35+
// ping messages are internal, they don't apper in public message streams
36+
export type WorkerMsg = Exclude<InternalWorkerMsg, WorkerPingMsg>;
37+
3438
/**
3539
* Message sent when the worker encounters an error that it can't
3640
* recover from, no more messages will be sent and the worker
@@ -42,6 +46,10 @@ export interface WorkerErrorMsg {
4246
errorStack?: string;
4347
}
4448

49+
export interface WorkerPingMsg {
50+
type: 'ping';
51+
}
52+
4553
const WORKER_STATE_TYPES: ReadonlyArray<WorkerMsg['type']> = [
4654
'running',
4755
'compiler issue',
@@ -50,10 +58,19 @@ const WORKER_STATE_TYPES: ReadonlyArray<WorkerMsg['type']> = [
5058
'worker error',
5159
];
5260

61+
export const isWorkerPing = (value: any): value is WorkerPingMsg =>
62+
typeof value === 'object' && value && value.type === 'ping';
63+
5364
export const isWorkerMsg = (value: any): value is WorkerMsg =>
5465
typeof value === 'object' && value && WORKER_STATE_TYPES.includes(value.type);
5566

5667
export class WorkerMsgs {
68+
ping(): WorkerPingMsg {
69+
return {
70+
type: 'ping',
71+
};
72+
}
73+
5774
error(error: Error): WorkerErrorMsg {
5875
return {
5976
type: 'worker error',

0 commit comments

Comments
 (0)