-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[apm] Annotation API documentation #65963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a741f9f
docs: first draft annotation api
bmorelli25 bff918c
docs: feedback
bmorelli25 8c47e27
docs: fix build error
bmorelli25 513a440
docs: fix for the fix
bmorelli25 5ea0e73
docs: add CURL example
bmorelli25 c9aff99
Merge branch 'master' into apm-annotation-api
elasticmachine 4de53c3
Merge branch 'master' into apm-annotation-api
bmorelli25 bea242e
docs: finalize
bmorelli25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,14 +9,45 @@ | |
| Some APM app features are provided via a REST API: | ||
|
|
||
| * <<agent-config-api>> | ||
|
|
||
| TIP: Kibana provides additional <<api,REST APIs>>, | ||
| and general information on <<using-api,how to use APIs>>. | ||
| * <<apm-annotation-api>> | ||
|
|
||
| Here's an example CURL request that adds an annotation to the APM app: | ||
|
|
||
| [source,curl] | ||
| ---- | ||
| 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-11T10:31:30.452Z", | ||
| "service": { | ||
| "version": "1.2" | ||
| }, | ||
| "message": "Revert upgrade", | ||
| "tags": [ | ||
| "elastic.co", "customer" | ||
| ] | ||
| }' | ||
| ---- | ||
|
|
||
| For more information, the Kibana <<api,REST API reference>> provides information on how to use Kibana APIs, | ||
| like required request headers and authentication options. | ||
|
|
||
| // AGENT CONFIG API | ||
| // GET --> Feature (APM) Read | ||
| // CREAT/EDIT/DELETE --> Feature (APM) All | ||
|
|
||
| // ANNOTATION API | ||
| // Feature (APM) All | ||
| // Index: `observability-annotations`. Privileges: `create_index`, `create_doc`, `manage`, and `read`. | ||
|
|
||
| //// | ||
| ******************************************************* | ||
| //// | ||
|
|
||
| [role="xpack"] | ||
| [[agent-config-api]] | ||
| === Agent Configuration API | ||
|
|
||
|
|
@@ -274,6 +305,117 @@ POST /api/apm/settings/agent-configuration/search | |
| } | ||
| -------------------------------------------------- | ||
|
|
||
| //// | ||
| ******************************************************* | ||
| ******************************************************* | ||
| //// | ||
|
|
||
| [role="xpack"] | ||
| [[apm-annotation-api]] | ||
| === Annotation API | ||
|
|
||
| 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. | ||
|
|
||
| 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 | ||
bmorelli25 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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`. | ||
|
|
||
| //// | ||
| ******************************************************* | ||
| //// | ||
|
|
||
| [[apm-annotation-create]] | ||
| ==== Create or update annotation | ||
|
|
||
| [[apm-annotation-config-req]] | ||
| ===== Request | ||
|
|
||
| `POST /api/apm/services/:serviceName/annotation` | ||
|
|
||
| [role="child_attributes"] | ||
| [[apm-annotation-config-req-body]] | ||
| ===== Request body | ||
|
|
||
| `service`:: | ||
| (required, object) Service identifying the configuration to create or update. | ||
| + | ||
| .Properties of `service` | ||
| [%collapsible%open] | ||
| ====== | ||
| `version` ::: | ||
| (required, string) Name of service. | ||
|
|
||
| `environment` ::: | ||
| (optional, string) Environment of service. | ||
| ====== | ||
|
|
||
| `@timestamp`:: | ||
| (required, string) The date and time of the annotation. Must be in https://www.w3.org/TR/NOTE-datetime[ISO 8601] format. | ||
bmorelli25 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| `message`:: | ||
| (optional, string) The message displayed in the annotation. Defaults to `service.version`. | ||
|
|
||
| `tags`:: | ||
| (optional, array) Tags are used by the APM app to distinguish APM annotations from other annotations. | ||
| Tags may have additional functionality in future releases. Defaults to `[apm]`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| [[apm-annotation-config-example]] | ||
| ===== Example | ||
|
|
||
| The following example creates an annotation for a service named `opbeans-java`. | ||
|
|
||
| [source,console] | ||
| -------------------------------------------------- | ||
| 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" | ||
| ] | ||
| } | ||
| -------------------------------------------------- | ||
|
|
||
| [[apm-annotation-config-body]] | ||
| ===== Response body | ||
|
|
||
| [source,js] | ||
| -------------------------------------------------- | ||
| { | ||
| "_index": "observability-annotations", | ||
| "_id": "Lc9I93EBh6DbmkeV7nFX", | ||
| "_version": 1, | ||
| "_seq_no": 12, | ||
| "_primary_term": 1, | ||
| "found": true, | ||
| "_source": { | ||
| "message": "Deployment 1.2", | ||
| "@timestamp": "2020-05-08T10:31:30.452Z", | ||
| "service": { | ||
| "version": "1.2", | ||
| "name": "opbeans-java" | ||
| }, | ||
| "tags": [ | ||
| "apm", | ||
| "elastic.co", | ||
| "customer" | ||
| ], | ||
| "annotation": { | ||
| "type": "deployment" | ||
| }, | ||
| "event": { | ||
| "created": "2020-05-09T02:34:43.937Z" | ||
| } | ||
| } | ||
| } | ||
| -------------------------------------------------- | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CREAT=>CREATE?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CREAT
C R E A T
C. R. E. A. T.