-
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
Changes from 9 commits
c337198
8eb4cc2
43d7d14
c4455ba
c50d984
bf61657
fab9a9e
10a96d6
70d5435
c124c34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
*/ | ||
import { schema } from '@kbn/config-schema'; | ||
import { IRouter } from 'src/core/server'; | ||
import { INDEX_NAMES } from '../../../common/constants'; | ||
import { wrapRouteWithLicenseCheck } from '../../../../licensing/server'; | ||
|
||
import { checkLicense } from '../../lib/check_license'; | ||
|
@@ -25,10 +24,9 @@ export function registerPipelineDeleteRoute(router: IRouter) { | |
router.handleLegacyErrors(async (context, request, response) => { | ||
const client = context.logstash!.esClient; | ||
|
||
await client.callAsCurrentUser('delete', { | ||
index: INDEX_NAMES.PIPELINES, | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. @delvedor I can't find There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. The API spec files have been merged in elastic/elasticsearch#67788 |
||
method: 'DELETE', | ||
}); | ||
|
||
return response.noContent(); | ||
|
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 #81536In #82716, we are going to provide a separate Elasticsearch client to address 2 & 3 points.
Logstash plugin will:
/_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.
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.
@roaksoax #83910