Skip to content

Commit a741f9f

Browse files
committed
docs: first draft annotation api
1 parent 49226dd commit a741f9f

File tree

4 files changed

+124
-2
lines changed

4 files changed

+124
-2
lines changed

docs/apm/api.asciidoc

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

1111
* <<agent-config-api>>
12+
* <<annotation-api>>
1213

1314
TIP: Kibana provides additional <<api,REST APIs>>,
1415
and general information on <<using-api,how to use APIs>>.
1516

17+
// Basic auth or API can be used
18+
// Need to talk about permissions req'd
19+
1620
////
1721
*******************************************************
1822
////
1923

24+
[role="xpack"]
2025
[[agent-config-api]]
2126
=== Agent Configuration API
2227

@@ -274,6 +279,116 @@ POST /api/apm/settings/agent-configuration/search
274279
}
275280
--------------------------------------------------
276281

282+
////
283+
*******************************************************
284+
*******************************************************
285+
////
286+
287+
[role="xpack"]
288+
[[apm-annotation-api]]
289+
=== Annotation API
290+
291+
The Annotation API allows you to annotate visualizations in the APM app with significant events, like deployments,
292+
allowing you to easily see how these events are impacting the performance of your existing applications.
293+
294+
The following APIs are available:
295+
296+
* <<apm-annotation-create>> to create an annotation for APM.
297+
// * <<obs-annotation-create>> POST /api/observability/annotation
298+
// * <<obs-annotation-get>> GET /api/observability/annotation/:id
299+
// * <<obs-annotation-delete>> DELETE /api/observability/annotation/:id
300+
301+
By default, annotations are stored in a newly created `observability-annotations` index.
302+
The name of this index is configurable with `CONFIG_NAME_AND_LINK_HERE`.
303+
277304
////
278305
*******************************************************
279306
////
307+
308+
[[apm-annotation-config]]
309+
==== Create or update annotation
310+
311+
[[apm-annotation-config-req]]
312+
===== Request
313+
314+
`POST /api/apm/services/:serviceName/annotation`
315+
316+
[role="child_attributes"]
317+
[[apm-annotation-config-req-body]]
318+
===== Request body
319+
320+
`service`::
321+
(required, object) Service identifying the configuration to create or update.
322+
+
323+
.Properties of `service`
324+
[%collapsible%open]
325+
======
326+
`version` :::
327+
(required, string) Name of service.
328+
329+
`environment` :::
330+
(optional, string) Environment of service.
331+
======
332+
333+
`@timestamp`::
334+
(required, string) The date and time of the annotation. Must be in https://www.w3.org/TR/NOTE-datetime[ISO 8601] format.
335+
336+
`message`::
337+
(optional, string) The message displayed in the annotation. Defaults to `service.version`.
338+
339+
`tags`::
340+
(optional, array) Tags that are useful for what? Defaults to `[apm]`.
341+
342+
[[apm-annotation-config-example]]
343+
===== Example
344+
345+
The following example creates an annotation for a service named `opbeans-java`.
346+
347+
[source,console]
348+
--------------------------------------------------
349+
POST /api/apm/services/opbeans-java/annotation
350+
{
351+
"@timestamp": "2020-05-08T10:31:30.452Z",
352+
"service": {
353+
"version": "1.2"
354+
},
355+
"message": "Deployment 1.2",
356+
"tags": [
357+
"elastic.co", "customer"
358+
]
359+
}
360+
--------------------------------------------------
361+
362+
[[apm-annotation-config-body]]
363+
===== Response body
364+
365+
[source,js]
366+
--------------------------------------------------
367+
{
368+
"_index": "observability-annotations",
369+
"_id": "Lc9I93EBh6DbmkeV7nFX",
370+
"_version": 1,
371+
"_seq_no": 12,
372+
"_primary_term": 1,
373+
"found": true,
374+
"_source": {
375+
"message": "Deployment 1.2",
376+
"@timestamp": "2020-05-08T10:31:30.452Z",
377+
"service": {
378+
"version": "1.2",
379+
"name": "opbeans-java"
380+
},
381+
"tags": [
382+
"apm",
383+
"elastic.co",
384+
"customer"
385+
],
386+
"annotation": {
387+
"type": "deployment"
388+
},
389+
"event": {
390+
"created": "2020-05-09T02:34:43.937Z"
391+
}
392+
}
393+
}
394+
--------------------------------------------------

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
@@ -74,6 +74,9 @@ Changing these settings may disable features of the APM App.
7474
| `apm_oss.sourcemapIndices`
7575
| Matcher for all {apm-server-ref}/sourcemap-indices.html[source map indices]. Defaults to `apm-*`.
7676

77+
| New setting
78+
| New setting description
79+
7780
|===
7881

7982
// end::general-apm-settings[]

0 commit comments

Comments
 (0)