Skip to content
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

[apm] Annotation API documentation #65963

Merged
merged 8 commits into from
May 20, 2020

Conversation

bmorelli25
Copy link
Member

@bmorelli25 bmorelli25 commented May 11, 2020

Summary

This PR adds documentation for the APM annotation API.


Documentation was created by running Kibana in dev mode from master and connecting to dev-next. Privileges needed are described in #65963 (comment). Here's an example curl request (with fake ApiKey)

curl --location --request POST 'http://localhost:5601/api/apm/services/opbeans-java/annotation' \
--header 'kbn-xsrf: foo' \
--header 'Authorization: ApiKey WHnA0SwM2pzR2Vxhc286TjlIRUJWNxelR4Mkx5wLWRUYUZmdzZycm3VadJ==' \
--header 'Content-Type: application/json' \
--data-raw '{
	"@timestamp": "2020-05-05T10:31:30.452Z",
	"service": {
		"version": "1.1"
	}
}'

@bmorelli25 bmorelli25 added Team:APM All issues that need APM UI Team support release_note:skip Skip the PR/issue when compiling release notes v7.8.0 labels May 11, 2020
@bmorelli25 bmorelli25 self-assigned this May 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

Copy link
Member Author

@bmorelli25 bmorelli25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgieselaar Here's a rough draft. Still some work to do, but I have a few questions first>

docs/apm/api.asciidoc Show resolved Hide resolved
docs/settings/apm-settings.asciidoc Outdated Show resolved Hide resolved
docs/apm/api.asciidoc Outdated Show resolved Hide resolved
docs/apm/api.asciidoc Show resolved Hide resolved
Comment on lines 17 to 18
// Basic auth or API can be used
// Need to talk about permissions req'd
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using the APM API, the user needs Kibana write permissions for APM (similar to the agent configuration APIs IIRC)

Can you be more specific? My first thought was create_doc on apm-* indices and create_index on apm-* indices, as described here, but that doesn't work. Presumably because these annotations are not stored in an index that matches that pattern.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the user indexing the annotations needs those permissions for observability-annotations, or whatever index name they set for xpack.observability.annotations.index. Additionally, for the APM endpoint, they need feature privileges (read and write) for APM: https://www.elastic.co/guide/en/kibana/current/kibana-privileges.html.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are the minimum privileges I was able to get to work:

Feature: APM --> all
Index: observability-annotations. Privileges: create_index, create_doc, manage, and read.

Does this sound correct to you? This is different from what you described, but I get 500s without manage and read on observability-annotations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - when we index an annotation we read it from ES immediately after so we can return the annotation as it is stored in ES. manage is needed for checking if the index exists (view_index_metadata works as well).

@bmorelli25 bmorelli25 requested a review from dgieselaar May 11, 2020 03:41
@bmorelli25 bmorelli25 force-pushed the apm-annotation-api branch from 895846a to bff918c Compare May 11, 2020 22:33
@bmorelli25
Copy link
Member Author

@elasticmachine, run elasticsearch-ci/docs

@dgieselaar
Copy link
Member

@bmorelli25 LMK when this needs a final review (IIRC this is not entirely finished yet?)

@bmorelli25
Copy link
Member Author

@elasticmachine merge upstream

@bmorelli25
Copy link
Member Author

@dgieselaar this is ready for a review! Permissions/roles will be added in a future PR as I'm not quite sure how I want to document that yet.

@bmorelli25 bmorelli25 self-assigned this May 19, 2020
Copy link
Member

@dgieselaar dgieselaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a couple of suggestions. Thanks @bmorelli25 !


`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]`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The apm tag will always be added by the endpoint, even if the user specifies other tags in the request. Should we clarify that?


// AGENT CONFIG API
// GET --> Feature (APM) Read
// CREAT/EDIT/DELETE --> Feature (APM) All
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CREAT => CREATE?

Copy link
Member Author

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.

@bmorelli25 bmorelli25 merged commit 203605e into elastic:master May 20, 2020
@bmorelli25 bmorelli25 deleted the apm-annotation-api branch May 20, 2020 21:35
bmorelli25 added a commit to bmorelli25/kibana that referenced this pull request May 20, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 21, 2020
* 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)
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 21, 2020
* master: (21 commits)
  [Alerting] Hides the `alert` SavedObjects type (elastic#66719)
  skip flaky suite (elastic#66869)
  fix visual baseline tests
  [kbn/optimizer] require fsevents on macos (elastic#67147)
  [APM] Fix obscured service map connections (elastic#67129)
  [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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:test-plan-7.8.0 release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support v7.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants