|
9 | 9 | Some APM app features are provided via a REST API: |
10 | 10 |
|
11 | 11 | * <<agent-config-api>> |
| 12 | +* <<annotation-api>> |
12 | 13 |
|
13 | 14 | TIP: Kibana provides additional <<api,REST APIs>>, |
14 | 15 | and general information on <<using-api,how to use APIs>>. |
15 | 16 |
|
| 17 | +// Basic auth or API can be used |
| 18 | +// Need to talk about permissions req'd |
| 19 | + |
16 | 20 | //// |
17 | 21 | ******************************************************* |
18 | 22 | //// |
19 | 23 |
|
| 24 | +[role="xpack"] |
20 | 25 | [[agent-config-api]] |
21 | 26 | === Agent Configuration API |
22 | 27 |
|
@@ -274,6 +279,116 @@ POST /api/apm/settings/agent-configuration/search |
274 | 279 | } |
275 | 280 | -------------------------------------------------- |
276 | 281 |
|
| 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 | + |
277 | 304 | //// |
278 | 305 | ******************************************************* |
279 | 306 | //// |
| 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 | +-------------------------------------------------- |
0 commit comments