-
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
Update logstash pipeline management to use system index APIs #80405
Update logstash pipeline management to use system index APIs #80405
Conversation
This change updates the logstash pipeline management plugin to use pipeline management APIs in Elasticsearch rather than directly accessing the .logstash index. In Elasticsearch 8.0, direct access to system indices will no longer be allowed when using standard APIs. Given this change, a new set of APIs has been created specifically for the management of Logstash pipelines and this change makes use of the APIs. Relates elastic/elasticsearch#53350
I have a concern about backward compatibility when this Kibana connects to Elasticsearch version < 7.9. For the role management, I am not quite sure but I think I am also new to Kibana. It would be great if a Kibana member can have a look. |
From the docs:
Given this moving Kibana to use these APIs is ok. Elasticsearch will have the APIs in 7.10+ and Kibana should always be the same version as Elasticsearch or older within the same minor, which should only be temporary for upgrades.
Good catch. |
@jaymode Will you continue your work on role management? Or you would like me to finish the rest of this PR? |
@kaisecheng if you don't mind finishing the PR that would be great! I've added you as a collaborator to my repository. |
@elasticmachine merge upstream |
…a into logstash_system_index_apis
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
index: INDEX_NAMES.PIPELINES, | ||
id: request.params.id, | ||
refresh: 'wait_for', | ||
await client.callAsCurrentUser('transport.request', { |
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.
-
Logstash plugin needs to be migrated to the new Elasticsearch client https://github.com/elastic/elasticsearch-js as we are going to remove the old one in v8.0. Changelog: https://github.com/elastic/kibana/blob/master/src/core/MIGRATION_EXAMPLES.md#elasticsearch-client
-
transport.request
doesn't provide type safety. -
The current implementation doesn't prefix endpoints with
_kibana
as outlined in the migration path for 7.x Kibana's system indices #81536
In #82716, we are going to provide a separate Elasticsearch client to address 2 & 3 points.
Logstash plugin will:
- migrate to provided SystemIndices Elasticsearch client
- adopt all usage places to make sure compatibility with the new Elasticsearch client version
- migrate to
/_logstash/pipeline/
endpoints (as done in this PR)
How soon do you want to migrate to System Indices? Can you wait for #82716?
@jaymode @kaisecheng
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.
Regarding 3, these APIs will not be prefixed with _kibana
as they exist in their own plugin within Elasticsearch and not within the Kibana system index plugin.
Ideally, I'd like to see us move the Logstash UI to use the system index APIs sooner rather than later to get more of the system index work into users' hands.
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.
Regarding 3, these APIs will not be prefixed with _kibana as they exist in their own plugin within Elasticsearch and not within the Kibana system index plugin.
Makes sense to merge it then. You just need to address 1st point then. Can be done in the follow-up.
Hopefully we can fix the 2nd problem as well with #80405 (comment)
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.
I will address 1st point as a follow-up issue
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.
@restrry is there a meta issue/transition plan to support the new elasticsearch-js client library (not just for logstash)?
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.
id: request.params.id, | ||
refresh: 'wait_for', | ||
await client.callAsCurrentUser('transport.request', { | ||
path: '/_logstash/pipeline/' + encodeURIComponent(request.params.id), |
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.
@delvedor I can't find /_logstash
support in the new Elasticsearch client. Why it so?
https://github.com/elastic/elasticsearch-js/blob/master/api/kibana.d.ts
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.
I'm not aware of that endpoint, and I wasn't able to find it in the rest-api-spec (and here). Are you sure it's a public API?
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.
I can't see them in the spec either, but they present in the code
https://github.com/elastic/elasticsearch/blob/fb7471b32955c80f1fe850054d68d5b66aca2896/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestGetPipelineAction.java#L32
https://github.com/elastic/elasticsearch/blob/fb7471b32955c80f1fe850054d68d5b66aca2896/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestPutPipelineAction.java#L35
https://github.com/elastic/elasticsearch/blob/fb7471b32955c80f1fe850054d68d5b66aca2896/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestDeletePipelineAction.java#L34
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.
The intent for these Logstash APIs is that they are for communication between the stack components and Elasticsearch so we intentionally did not publish a rest api spec for these. If this is necessary, we can probably add specs for these APIs.
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.
communication between the stack components and Elasticsearch so we intentionally did not publish a rest api spec for these.
Can we add a separate REST API spec for such cases? We need to make sure that all the changes in REST API are reflected in the Kibana code as well - we rely on TypeScript type definitions generated from REST API spec.
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.
++ another vote on this. I'd be nice to leverage the safety net y'all created with the API spec, but for product to product APIs
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.
Sorry for missing an update here, the ES team discussed this and came to the conclusion that we'd add a spec and docs for this API. This work hasn't been started yet.
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.
The API spec files have been merged in elastic/elasticsearch#67788
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Distributable file count
History
To update your PR or re-run it, just comment with: |
…ts-public * upstream/master: (57 commits) Remove unused asciidoc file (elastic#83228) [Lens] Remove background from lens embeddable (elastic#83061) [Discover] Unskip flaky tests based on discover fixture index pattern (elastic#82991) Removing unnecessary trailing slash in CODEOWNERS Trying to fix CODEOWNERS again, where was a non-existent team prior (elastic#83236) Trying to fix CODEOWERS, missing a starting slash (elastic#83233) skip flaky suite (elastic#83231) Add enzyme rerender test helper (elastic#83208) Move Elasticsearch type definitions out of APM (elastic#83081) [ts/checkTsProjects] produce a more useful error message (elastic#83209) [kbnClient] retry updating config if necessary (elastic#83205) I accidentally removed this line in a recent PR (elastic#83201) Don't make the caller do work the function can do (elastic#83180) [App Search] Update EngineRouter & EngineNav to use EngineLogic (elastic#83138) [Workplace Search] Add routes for Sources (elastic#83125) Update logstash pipeline management to use system index APIs (elastic#80405) [ML] Replace EuiBasicTable with EuiInMemoryTable (elastic#83057) [Metrics UI] Add basic interaction and shell for node details overlay (elastic#82013) [App Search] Added the log retention confirmation modal to the Settings page (elastic#83009) [docs] Fix create map title in import geospatial page (elastic#83172) ...
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…#80405) This change updates the logstash pipeline management plugin to use pipeline management APIs in Elasticsearch rather than directly accessing the .logstash index. In Elasticsearch 8.0, direct access to system indices will no longer be allowed when using standard APIs. Given this change, a new set of APIs has been created specifically for the management of Logstash pipelines and this change makes use of the APIs. Co-authored-by: Kaise Cheng <[email protected]> Co-authored-by: Kibana Machine <[email protected]> ES:elastic#53350 LS:elastic#12291
…#83526) This change updates the logstash pipeline management plugin to use pipeline management APIs in Elasticsearch rather than directly accessing the .logstash index. In Elasticsearch 8.0, direct access to system indices will no longer be allowed when using standard APIs. Given this change, a new set of APIs has been created specifically for the management of Logstash pipelines and this change makes use of the APIs. Co-authored-by: Kaise Cheng <[email protected]> Co-authored-by: Kibana Machine <[email protected]> ES:#53350 LS:#12291 Co-authored-by: Jay Modi <[email protected]>
Summary
This change updates the logstash pipeline management plugin to use
pipeline management APIs in Elasticsearch rather than directly
accessing the .logstash index. In Elasticsearch 8.0, direct access to
system indices will no longer be allowed when using standard APIs.
Given this change, a new set of APIs has been created specifically for
the management of Logstash pipelines and this change makes use of the
APIs.
Relates elastic/elasticsearch#53350
Checklist
For maintainers