-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[CM] Event Stream service #153211
[CM] Event Stream service #153211
Conversation
686d8bf
to
97eb918
Compare
Pinging @elastic/appex-sharedux (Team:SharedUX) |
src/plugins/content_management/server/event_stream/event_stream_service.ts
Outdated
Show resolved
Hide resolved
src/plugins/content_management/server/event_stream/event_stream_service.ts
Outdated
Show resolved
Hide resolved
src/plugins/content_management/server/event_stream/memory/memory_event_stream_client.test.ts
Show resolved
Hide resolved
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.
Amazing work @vadimkibana ! Overall looks great, I left a few questions but no blockers. Great test coverage 👍
src/plugins/content_management/server/event_stream/es/es_event_stream_client.ts
Show resolved
Hide resolved
...s/content_management/server/event_stream/es/integration_tests/es_event_stream_client.test.ts
Show resolved
Hide resolved
src/plugins/content_management/server/event_stream/memory/memory_event_stream_client.test.ts
Show resolved
Hide resolved
src/plugins/content_management/server/event_stream/event_stream_service.ts
Show resolved
Hide resolved
596fc9a
to
7424307
Compare
0055e78
to
f254c6c
Compare
@elasticmachine merge upstream |
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.
DataDiscovery changes LGTM (code review only), suggested tests.
Maybe take a look at ES client retry logic, maybe disable. Maybe idempotent id generate on client. |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
LGTM, thanks for the changes!
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.
LGTM
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
## 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 <[email protected]> Co-authored-by: Anton Dosov <[email protected]>
Summary
This PR implements the Event Stream service for Content Management.
For high-level overview see:
Implementation details in this PR:
EventStreamService
high-level class, which is the public interface to the Event Stream, holds any necessary state, and follows plugin life-cycle methods.EventStreamClient
interface.EventStreamClient
implementations:EsEventStreamClient
is the production implementation, which stores events to Elasticsearch.MemoryEventStreamClient
is used for testing and could be used for demo purposes.testEventStreamClient
is reused forEsEventStreamClient
andMemoryEventStreamClient
, which should help with verifying that both implements work correctly and the same. ForEsEventStreamClient
it is executed as Kibana integration test, but forMemoryEventStreamClient
it is executed as a Jest test.EventStreamService
events are buffered for 250ms or up to 100 events before they are flushed to the storage..kibana-event-stream
data stream.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.txId
field, which can be used to correlate multiple related events together or to store the transaction ID._bulk
request API.Checklist
Delete any items that are not applicable to this PR.
For maintainers