-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Streams] Introducing the new Streams plugin #198713
Conversation
Great start! @dgieselaar as discussed I think we should add the following things during the week and aim to get it merged by Friday:
Everything else can probably happen on a separate PR (that we ideally have in by Friday as well):
|
Next stepsd:
|
Pinging @elastic/unified-observability (Team:Observability) |
@dgieselaar For your changes on the UI side, should we backport this to 8.x to avoid conflicts? Or is it OK to only keep on main? |
@flash1293 I will create a separate PR for the changes that impact other plugins, and I'll backport that to 8.x, but the streams app plugin only needs to go into 9.x |
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.
New plugin LGTM, reviewed new server APIs.
options: { | ||
access: 'public', | ||
security: { |
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.
Availability is not documented yet, but in this case we can set this (and other APIs) to experimental
options: { | |
access: 'public', | |
security: { | |
options: { | |
access: 'public', | |
availability: { | |
stability: 'experimental' | |
}, | |
security: { |
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.
Thanks, set to experimental
Buildkite is having an outage, holding back with trying to get green CI on this for now |
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.
packages/kbn-optimizer/limits.yml
query: { | ||
bool: { | ||
filter: { | ||
prefix: { |
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.
👍
…elaar since we don't have an official team for this plugin yet.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
|
## Summary This PR introduces the new experimental "Streams" plugin into the Kibana project. The Streams project aims to simplify workflows around dealing with messy logs in Elasticsearch. Our current offering is either extremely opinionated with integrations or leaves the user alone with the high flexibility of Elasticsearch concepts like index templates, component templates and so on, which make it challenging to configure everything correctly for good performance and controlling search speed and cost. ### Scope of PR - Provides an API for the user to "enable" the streams framework which creates the "root" entity `logs` with all the backing Elasticsearch assets - Provides an API for the user to "fork" a stream - Provides an API for the user to "read" a stream and all of it's Elasticsearch assets. - Provides an API for the user to upsert a stream (and implicitly child streams that are mentioned) - Part of this API is placing grok and disscect processing steps as well as fields to the mapping - Implements the Stream Naming Schema (SNS) which uses dots to express the index patterns and stream IDs. Example: `logs.nginx.errors` - The APIs will fully manage the `index_template`, `component_template`, and `ingest_pipelines`. ### Out of scope - Integration tests (coming in a follow-up) ### Reviewer Notes - I haven't implemented tests beyond a unit test for converting the filter conditions to Painless. I wanted to get a PR up so we can start iterating on the interface and functionality before we invest in testing. - You might need to add `server.versioned.versionResolution: oldest` to your `config/kibana.dev.yaml` to play with the requests below in the Kibana "Dev console". ### Example API Calls Enable the root stream (and set the mapping for the internal `.streams` index) ``` POST kbn:/api/streams/_enable ``` Read the root entity "logs" ``` GET kbn:/api/streams/logs ``` Fork the "root" entity "logs" and create "logs.nginx" based on a condition ``` POST kbn:/api/streams/logs/_fork { "stream": { "id": "logs.nginx", "children": [], "processing": [], "fields": [], }, "condition": { "field": "log.logger", "operator": "eq", "value": "nginx_proxy" } } ``` Fork the entity "logs.nginx" and create "logs.nginx.errors" based on a condition ``` POST kbn:/api/streams/logs.nginx/_fork { "stream": { "id": "logs.nginx.error", "children": [], "processing": [], "fields": [], }, "condition": { "or": [ { "field": "log.level", "operator": "eq", "value": "error" }, { "field": "log.level", "operator": "eq", "value": "ERROR" } ] } } ``` Set some processing on a stream and map the generated field ``` PUT kbn:/api/streams/logs.nginx { "children": [], "processing": [ { "config": { "type": "grok", "patterns": ["^%{IP:ip} – –"], "field": "message" } } ], "fields": [ { "name": "ip", "type": "ip" } ], } } ``` Field definitions are checked for both descendants and ancestors for incompatibilities to ensure they stay additive. If children are defined in the `PUT /api/streams/<name>` API, sub-streams are created implicitly. If a stream is `PUT`, it's added to the parent as well with a condition that is never true (can be edited subsequently). `POST /api/streams/_resync` can be used to re-sync all streams from their meta data in case the Elasticsearch objects got messed up by some external change - not sure whether we want to keep that. Follow-ups * API integration tests * Check read permissions on data streams to determine whether a user is allowed to read certain streams --------- Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: kibanamachine <[email protected]>
## Summary This PR introduces the new experimental "Streams" plugin into the Kibana project. The Streams project aims to simplify workflows around dealing with messy logs in Elasticsearch. Our current offering is either extremely opinionated with integrations or leaves the user alone with the high flexibility of Elasticsearch concepts like index templates, component templates and so on, which make it challenging to configure everything correctly for good performance and controlling search speed and cost. ### Scope of PR - Provides an API for the user to "enable" the streams framework which creates the "root" entity `logs` with all the backing Elasticsearch assets - Provides an API for the user to "fork" a stream - Provides an API for the user to "read" a stream and all of it's Elasticsearch assets. - Provides an API for the user to upsert a stream (and implicitly child streams that are mentioned) - Part of this API is placing grok and disscect processing steps as well as fields to the mapping - Implements the Stream Naming Schema (SNS) which uses dots to express the index patterns and stream IDs. Example: `logs.nginx.errors` - The APIs will fully manage the `index_template`, `component_template`, and `ingest_pipelines`. ### Out of scope - Integration tests (coming in a follow-up) ### Reviewer Notes - I haven't implemented tests beyond a unit test for converting the filter conditions to Painless. I wanted to get a PR up so we can start iterating on the interface and functionality before we invest in testing. - You might need to add `server.versioned.versionResolution: oldest` to your `config/kibana.dev.yaml` to play with the requests below in the Kibana "Dev console". ### Example API Calls Enable the root stream (and set the mapping for the internal `.streams` index) ``` POST kbn:/api/streams/_enable ``` Read the root entity "logs" ``` GET kbn:/api/streams/logs ``` Fork the "root" entity "logs" and create "logs.nginx" based on a condition ``` POST kbn:/api/streams/logs/_fork { "stream": { "id": "logs.nginx", "children": [], "processing": [], "fields": [], }, "condition": { "field": "log.logger", "operator": "eq", "value": "nginx_proxy" } } ``` Fork the entity "logs.nginx" and create "logs.nginx.errors" based on a condition ``` POST kbn:/api/streams/logs.nginx/_fork { "stream": { "id": "logs.nginx.error", "children": [], "processing": [], "fields": [], }, "condition": { "or": [ { "field": "log.level", "operator": "eq", "value": "error" }, { "field": "log.level", "operator": "eq", "value": "ERROR" } ] } } ``` Set some processing on a stream and map the generated field ``` PUT kbn:/api/streams/logs.nginx { "children": [], "processing": [ { "config": { "type": "grok", "patterns": ["^%{IP:ip} – –"], "field": "message" } } ], "fields": [ { "name": "ip", "type": "ip" } ], } } ``` Field definitions are checked for both descendants and ancestors for incompatibilities to ensure they stay additive. If children are defined in the `PUT /api/streams/<name>` API, sub-streams are created implicitly. If a stream is `PUT`, it's added to the parent as well with a condition that is never true (can be edited subsequently). `POST /api/streams/_resync` can be used to re-sync all streams from their meta data in case the Elasticsearch objects got messed up by some external change - not sure whether we want to keep that. Follow-ups * API integration tests * Check read permissions on data streams to determine whether a user is allowed to read certain streams --------- Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: kibanamachine <[email protected]>
Creates the Streams app plugin, which renders UI for managing streams (see #198713). Additional changes in this PR: - The menus were updated to conditionally add a link to the Streams app. The Streams plugin itself returns a status$ observable which signals if Streams have been enabled. This value is used to conditionally render the link in the various flavors of menus. - There's a small change in the ES types to allow for ordered params in ES|QL (vs named params) - `@kbn/server-route-repository` was updated to be able to override `access` (instead of only inferring it from the endpoint name). Additionally, we now allow all route options by default. - `@kbn/typed-react-router-config` now also exports a `useBreadcrumbs`. This was copied over from the APM implementation. - the signature of the `esql` method in `ObservabilityElasticsearchClient` was updated to separate processing options from options that are sent over to the _query endpoint. --------- Co-authored-by: Chris Cowan <[email protected]> Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: kibanamachine <[email protected]>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary This PR introduces the new experimental "Streams" plugin into the Kibana project. The Streams project aims to simplify workflows around dealing with messy logs in Elasticsearch. Our current offering is either extremely opinionated with integrations or leaves the user alone with the high flexibility of Elasticsearch concepts like index templates, component templates and so on, which make it challenging to configure everything correctly for good performance and controlling search speed and cost. ### Scope of PR - Provides an API for the user to "enable" the streams framework which creates the "root" entity `logs` with all the backing Elasticsearch assets - Provides an API for the user to "fork" a stream - Provides an API for the user to "read" a stream and all of it's Elasticsearch assets. - Provides an API for the user to upsert a stream (and implicitly child streams that are mentioned) - Part of this API is placing grok and disscect processing steps as well as fields to the mapping - Implements the Stream Naming Schema (SNS) which uses dots to express the index patterns and stream IDs. Example: `logs.nginx.errors` - The APIs will fully manage the `index_template`, `component_template`, and `ingest_pipelines`. ### Out of scope - Integration tests (coming in a follow-up) ### Reviewer Notes - I haven't implemented tests beyond a unit test for converting the filter conditions to Painless. I wanted to get a PR up so we can start iterating on the interface and functionality before we invest in testing. - You might need to add `server.versioned.versionResolution: oldest` to your `config/kibana.dev.yaml` to play with the requests below in the Kibana "Dev console". ### Example API Calls Enable the root stream (and set the mapping for the internal `.streams` index) ``` POST kbn:/api/streams/_enable ``` Read the root entity "logs" ``` GET kbn:/api/streams/logs ``` Fork the "root" entity "logs" and create "logs.nginx" based on a condition ``` POST kbn:/api/streams/logs/_fork { "stream": { "id": "logs.nginx", "children": [], "processing": [], "fields": [], }, "condition": { "field": "log.logger", "operator": "eq", "value": "nginx_proxy" } } ``` Fork the entity "logs.nginx" and create "logs.nginx.errors" based on a condition ``` POST kbn:/api/streams/logs.nginx/_fork { "stream": { "id": "logs.nginx.error", "children": [], "processing": [], "fields": [], }, "condition": { "or": [ { "field": "log.level", "operator": "eq", "value": "error" }, { "field": "log.level", "operator": "eq", "value": "ERROR" } ] } } ``` Set some processing on a stream and map the generated field ``` PUT kbn:/api/streams/logs.nginx { "children": [], "processing": [ { "config": { "type": "grok", "patterns": ["^%{IP:ip} – –"], "field": "message" } } ], "fields": [ { "name": "ip", "type": "ip" } ], } } ``` Field definitions are checked for both descendants and ancestors for incompatibilities to ensure they stay additive. If children are defined in the `PUT /api/streams/<name>` API, sub-streams are created implicitly. If a stream is `PUT`, it's added to the parent as well with a condition that is never true (can be edited subsequently). `POST /api/streams/_resync` can be used to re-sync all streams from their meta data in case the Elasticsearch objects got messed up by some external change - not sure whether we want to keep that. Follow-ups * API integration tests * Check read permissions on data streams to determine whether a user is allowed to read certain streams --------- Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit b86dc81) # Conflicts: # .github/CODEOWNERS
# Backport This will backport the following commits from `main` to `8.x`: - [[Streams] Introducing the new Streams plugin (#198713)](#198713) <!--- Backport version: 7.3.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT {commits} BACKPORT--> Co-authored-by: Chris Cowan <[email protected]>
Creates the Streams app plugin, which renders UI for managing streams (see elastic#198713). Additional changes in this PR: - The menus were updated to conditionally add a link to the Streams app. The Streams plugin itself returns a status$ observable which signals if Streams have been enabled. This value is used to conditionally render the link in the various flavors of menus. - There's a small change in the ES types to allow for ordered params in ES|QL (vs named params) - `@kbn/server-route-repository` was updated to be able to override `access` (instead of only inferring it from the endpoint name). Additionally, we now allow all route options by default. - `@kbn/typed-react-router-config` now also exports a `useBreadcrumbs`. This was copied over from the APM implementation. - the signature of the `esql` method in `ObservabilityElasticsearchClient` was updated to separate processing options from options that are sent over to the _query endpoint. --------- Co-authored-by: Chris Cowan <[email protected]> Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: kibanamachine <[email protected]>
Creates the Streams app plugin, which renders UI for managing streams (see elastic#198713). Additional changes in this PR: - The menus were updated to conditionally add a link to the Streams app. The Streams plugin itself returns a status$ observable which signals if Streams have been enabled. This value is used to conditionally render the link in the various flavors of menus. - There's a small change in the ES types to allow for ordered params in ES|QL (vs named params) - `@kbn/server-route-repository` was updated to be able to override `access` (instead of only inferring it from the endpoint name). Additionally, we now allow all route options by default. - `@kbn/typed-react-router-config` now also exports a `useBreadcrumbs`. This was copied over from the APM implementation. - the signature of the `esql` method in `ObservabilityElasticsearchClient` was updated to separate processing options from options that are sent over to the _query endpoint. --------- Co-authored-by: Chris Cowan <[email protected]> Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 63da770) # Conflicts: # .github/CODEOWNERS
Creates the Streams app plugin, which renders UI for managing streams (see elastic#198713). Additional changes in this PR: - The menus were updated to conditionally add a link to the Streams app. The Streams plugin itself returns a status$ observable which signals if Streams have been enabled. This value is used to conditionally render the link in the various flavors of menus. - There's a small change in the ES types to allow for ordered params in ES|QL (vs named params) - `@kbn/server-route-repository` was updated to be able to override `access` (instead of only inferring it from the endpoint name). Additionally, we now allow all route options by default. - `@kbn/typed-react-router-config` now also exports a `useBreadcrumbs`. This was copied over from the APM implementation. - the signature of the `esql` method in `ObservabilityElasticsearchClient` was updated to separate processing options from options that are sent over to the _query endpoint. --------- Co-authored-by: Chris Cowan <[email protected]> Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: kibanamachine <[email protected]>
Summary
This PR introduces the new experimental "Streams" plugin into the Kibana project. The Streams project aims to simplify workflows around dealing with messy logs in Elasticsearch. Our current offering is either extremely opinionated with integrations or leaves the user alone with the high flexibility of Elasticsearch concepts like index templates, component templates and so on, which make it challenging to configure everything correctly for good performance and controlling search speed and cost.
Scope of PR
logs
with all the backing Elasticsearch assetslogs.nginx.errors
index_template
,component_template
, andingest_pipelines
.Out of scope
Reviewer Notes
server.versioned.versionResolution: oldest
to yourconfig/kibana.dev.yaml
to play with the requests below in the Kibana "Dev console".Example API Calls
Enable the root stream (and set the mapping for the internal
.streams
index)Read the root entity "logs"
Fork the "root" entity "logs" and create "logs.nginx" based on a condition
Fork the entity "logs.nginx" and create "logs.nginx.errors" based on a condition
Set some processing on a stream and map the generated field
Field definitions are checked for both descendants and ancestors for incompatibilities to ensure they stay additive.
If children are defined in the
PUT /api/streams/<name>
API, sub-streams are created implicitly. If a stream isPUT
, it's added to the parent as well with a condition that is never true (can be edited subsequently).POST /api/streams/_resync
can be used to re-sync all streams from their meta data in case the Elasticsearch objects got messed up by some external change - not sure whether we want to keep that.Follow-ups