Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [RCA] [Recent events] Create API endpoint to get events (elasti…
…c#192947) (elastic#193463) # Backport This will backport the following commits from `main` to `8.x`: - [[RCA] [Recent events] Create API endpoint to get events (elastic#192947)](elastic#192947) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Bena Kansara","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-17T09:50:09Z","message":"[RCA] [Recent events] Create API endpoint to get events (elastic#192947)\n\nCloses https://github.com/elastic/observability-dev/issues/3924\r\nCloses https://github.com/elastic/observability-dev/issues/3927\r\n\r\nThis PR introduces an events API (`/api/observability/events`) that will\r\nfetch -\r\n- All the \"point in time\" annotations from` observability-annotations`\r\nindex. This includes both manual and auto (e.g. service deployment)\r\nannotations\r\n- The annotations will be filtered with supported source fields\r\n(host.name, service.name, slo.id, slo.instanceId) when specified as\r\n`filter`\r\n- Alerts that newly triggered on same source in given time range. The\r\nsource needs to be specified as `filter`, when no filter is specified\r\nall alerts triggered in given time range will be returned\r\n\r\n### Testing\r\n- Create annotations (APM service deployment annotations and annotations\r\nusing Observability UI)\r\n- Generate some alerts\r\n- API call should return annotations and alerts, example API requests\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"annotation.type\":\"deployment\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"slo.id\":\"*\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"host.name\":\"host-0\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z`\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"808212e97e413216655aaa9e755c671656decb46","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","auto-backport","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0","backport:version"],"title":"[RCA] [Recent events] Create API endpoint to get events","number":192947,"url":"https://github.com/elastic/kibana/pull/192947","mergeCommit":{"message":"[RCA] [Recent events] Create API endpoint to get events (elastic#192947)\n\nCloses https://github.com/elastic/observability-dev/issues/3924\r\nCloses https://github.com/elastic/observability-dev/issues/3927\r\n\r\nThis PR introduces an events API (`/api/observability/events`) that will\r\nfetch -\r\n- All the \"point in time\" annotations from` observability-annotations`\r\nindex. This includes both manual and auto (e.g. service deployment)\r\nannotations\r\n- The annotations will be filtered with supported source fields\r\n(host.name, service.name, slo.id, slo.instanceId) when specified as\r\n`filter`\r\n- Alerts that newly triggered on same source in given time range. The\r\nsource needs to be specified as `filter`, when no filter is specified\r\nall alerts triggered in given time range will be returned\r\n\r\n### Testing\r\n- Create annotations (APM service deployment annotations and annotations\r\nusing Observability UI)\r\n- Generate some alerts\r\n- API call should return annotations and alerts, example API requests\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"annotation.type\":\"deployment\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"slo.id\":\"*\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"host.name\":\"host-0\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z`\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"808212e97e413216655aaa9e755c671656decb46"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192947","number":192947,"mergeCommit":{"message":"[RCA] [Recent events] Create API endpoint to get events (elastic#192947)\n\nCloses https://github.com/elastic/observability-dev/issues/3924\r\nCloses https://github.com/elastic/observability-dev/issues/3927\r\n\r\nThis PR introduces an events API (`/api/observability/events`) that will\r\nfetch -\r\n- All the \"point in time\" annotations from` observability-annotations`\r\nindex. This includes both manual and auto (e.g. service deployment)\r\nannotations\r\n- The annotations will be filtered with supported source fields\r\n(host.name, service.name, slo.id, slo.instanceId) when specified as\r\n`filter`\r\n- Alerts that newly triggered on same source in given time range. The\r\nsource needs to be specified as `filter`, when no filter is specified\r\nall alerts triggered in given time range will be returned\r\n\r\n### Testing\r\n- Create annotations (APM service deployment annotations and annotations\r\nusing Observability UI)\r\n- Generate some alerts\r\n- API call should return annotations and alerts, example API requests\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"annotation.type\":\"deployment\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"slo.id\":\"*\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z&filter={\"host.name\":\"host-0\"}`\r\n-\r\n`http://localhost:5601/kibana/api/observability/events?rangeFrom=2024-09-01T19:53:20.243Z&rangeTo=2024-09-19T19:53:20.243Z`\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"808212e97e413216655aaa9e755c671656decb46"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Bena Kansara <[email protected]>
- Loading branch information