mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
## Summary This PR implements the Event Stream service for Content Management. For high-level overview see: - [Event Stream technical summary](https://docs.google.com/document/d/1nyMhb0p4gNV43OVF6cLJkxhMf2V4V1BIjPsnACxe_t0/edit#heading=h.typ7x7sxmeye) (a bit old, but still good as general overview read) Implementation details in this PR: - This PR introduces the `EventStreamService` high-level class, which is the public interface to the Event Stream, holds any necessary state, and follows plugin life-cycle methods. - On a lower level the actual event storage is defined in the `EventStreamClient` interface. - There are two `EventStreamClient` implementations: - `EsEventStreamClient` is the production implementation, which stores events to Elasticsearch. - `MemoryEventStreamClient` is used for testing and could be used for demo purposes. - The same test suite `testEventStreamClient` is reused for `EsEventStreamClient` and `MemoryEventStreamClient`, which should help with verifying that both implements work correctly and the same. For `EsEventStreamClient` it is executed as Kibana integration test, but for `MemoryEventStreamClient` it is executed as a Jest test. - In `EventStreamService` events are buffered for 250ms or up to 100 events before they are flushed to the storage. - Events are stored in the `.kibana-event-stream` data stream. - The data stream and index template are create during plugin initialization "start" life-cycle, similar to how it is done in the Event Log and in the Reporting index. - The mappings define a `meta` field, which is currently unused, but will allow to add more fields in the future without needing to change the schema of the data stream. - The mappings define a transaction ID `txId` field, which can be used to correlate multiple related events together or to store the transaction ID. - Events are written to Elasticsearch using the `_bulk` request API. ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co> |
||
---|---|---|
.. | ||
src | ||
BUILD.bazel | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/es-query
Shared common (client and server sie) utilities shared across packages and plugins.