-
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
[Fleet] Add support for input type packages #133296
Comments
Pinging @elastic/fleet (Team:Fleet) |
Contextualizing the open questions we have so far:
Consider the following scenario:
Once we arrive at step number 4, we'll have a conflict when we install the One approach to resolve this conflict might be to adjust the naming of the conflicting index template, data streams, etc generated from installing the Or, we could prefix these assets with the integration name when creating them for input packages, e.g.
We should be able to add some conditional logic to install index templates as part of the integration policy creation process, but it stands to reason that this logic might belong in the proposed "customization" API linked above. The thinking there is that we'll be exposing functionality like "add additional datasets to an integration" via this customization API eventually, so we could potentially start on this now. |
I've been working on contextualizing how we might solve the problems today that we're proposing to solve with input packages, based on this ask from @joshdover:
So, I'll enumerate some of the goals of input package as I understand them:
As it stands today, Fleet and the existing Provide a custom
|
Few comments on my end:
|
+1 the package policy is the upgrade path I am most concerned about. We need to understand the risk of continuing to add more packages of this kind in the integration-type packages format if we're going to need to support a smooth package policy upgrade path to a future input-type package format. We need to be sure we can migrate any input vars from an integration package to an input package policy. If there are any patterns that we should avoid doing in these integration packages today to make that package policy upgrade to an input package smoother, it'd be good to know that before adding more "input" packages that are written in the integration-type format. @kpollich let me know if that's not clear. |
Correct, I was just using this name to be demonstrative about what I was doing in the screenshots. If we provide first class documentation for this manual process, we should align the naming conventions with what Fleet generates, I agree.
This makes sense. I'll make a note in the description to capture the need to hide the ingest pipelines and templates elements in the policy editor for input packages.
Thanks for clarifying. I understand the need for definition here. It seems our goals with upgrades from non-input packages to input packages are as follows:
Where I see potential for issues is migrating a package that doesn't already define
We need to use the previous version of a package to determine what dataset it's currently writing to because input packages will no longer include data streams. There might be a way to resolve this from the existing policy object, as well. To more specifically address @joshdover's concern here:
One thing that will probably make the upgrade process smoother would be adding the I don't think I've come across anything in terms of patterns in the other direction though, i.e. those that would actively harm the upgrade process when migrating to input packages. Maybe adding additional data streams to a package that's a candidate for migration would cause additional complexity. I'll detail further down below in the questions section. QuestionsSomething I'm not clear on is the number of inputs defined by an input package. Will there always be a single input for all input packages? e.g. consider the
Would there ever be a case where a package with multiple data streams like this is migrated to an input package? I don't think this would cause any problems, but we'd need to prompt for I would also like to know if there's a list of packages anywhere that are candidates for migration to input packages. Perusing the integrations repo I see some migration efforts planned but it's not clear to me what those actually are. There's an input label that I was hoping would be helpful, but it looks largely unused. Something like the logfile -> filestream migration list would be quite helpful in investigating any potential migration issues on Fleet's side of things. |
Even though that fixes the misleading part and is likely a quick fix, as soon as we have input packages it is at the core to provide this properly.
An input package can only define a single input. @mtojek I assume this is also represented in the package-spec? Here you can find a list of inputs: https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html It is the filebeat inputs but if any of these names show up in a package, these should be input packages. Keep in mind, that we blocked so far of creating more "input packages" because the concept didn't exist. For your redis example, redis is likely a bad example that we should not migrate. All this redis input does is gathering the slowlog from redis. |
I sent this to you via DM as it's currently private.
Thanks for your investigation here. AFAIK all of the existing "input" packages use this already, so I think we should be ok here.
Agreed that custom ingest pipelines and index templates are central to this feature, so we do need to provide ways for users to create these from the UI, just like we do for integrations. I think we need to define a few things here to make this feature successful in the context of input packages:
cc @akshay-saraswat - we need to include a solution to this in the UX mocks you're working on. It would be good to sync up with @kpollich and discuss options before getting too far. |
I think this will be similar to what we're doing with #133740. For integration packages, we create the ingest pipeline, component templates, and index template at the time of package installation. Most often, this occurs when the first integration policy for that package is created. So, in #133740, we don't display the "links" UI to view/edit your index template or ingest pipeline until after you've created your first policy. I think a similar workflow can apply to input packages, but we can only install the ingest pipeline, component templates, and index template at the time of policy creation, because we need to know the configured dataset value to create these objects for the user. So, in the create policy context where we're creating a brand new policy, we won't show the "links" UI, and we'll create the templates + pipeline. Then, after saving the policy, Fleet will create these resources. We should be able to link them to the given policy through
This is a pretty involved problem to solve and will likely require substantial UX investment as you've mentioned. Prompting the user for how we should handle dataset change feels like the right starting point for me, but we'll need UX direction on how to present the options/what the options are, and implementation work to actually support each option. I don't think we have any existing support or similar logic for the copy/move/merge actions we're proposing here. |
Unassigning myself since I think technical definition is complete here to the point that we could start on phases 1 and 2 in an upcoming iteration. Phase 3 will likely need additional definition and design resources, and should be prioritized as a later scope of work in a future iteration. |
## Summary Closes #145903 Added datasets combo box to input type packages `Dataset name` variable with the option of creating a new one. Using the existing `/data_streams` API to show the list of all datasets. Package policy create/edit API already supports setting the value of `data_stream.dataset` (input packages should have this variable as described in #133296) To verify: - Start local EPR with input type packages as described [here](#140035 (comment)) - Add `Custom Logs` integration - Verify that Dataset name displays a dropdown and the selected value is persisted. - Verify that a new value can be entered in Dataset name - Verify that Edit integration policy displays the existing value and allows selecting/creating another one. <img width="924" alt="image" src="https://user-images.githubusercontent.com/90178898/205680787-3ef7da08-f5f0-4f05-b8d7-3a1c0a6a3d56.png"> <img width="1008" alt="image" src="https://user-images.githubusercontent.com/90178898/205679497-935fe450-ce78-4f0b-943e-58e7f851f44b.png"> <img width="1006" alt="image" src="https://user-images.githubusercontent.com/90178898/205679589-fedbbe0e-2c4d-4c00-986f-34ec5c2eb2f6.png"> Added ordering of datasets to move up those that start with the package name e.g. `system*` datasets come first if adding a `system` integration. Other than that ordering datasets alphabetically. <img width="482" alt="image" src="https://user-images.githubusercontent.com/90178898/205924837-a9807c92-2fe4-431a-88c6-f161d00812fb.png"> The rest of the requirements seem to be already implemented, see [comments](#145903 (comment)) ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [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
@kpollich @jen-huang I think the aspiration is that input packages will become GA in 8.7, I think we should discuss what is required for us to get there (I think we are really close). I think it should be a conscious decision on our part to "release" input package support and make sure we are happy with the feature and I want to kick off that conversation. Here are 2 issues which are currently top of my mind for input packages at the moment and I think should be considered before we go GA:
I would like to see a "real" input integration working too as all work has been done using test packages, I know that @ishleenk17 is working on the Jolokia Input Integration, there are 3 beta input packages on the EPR at the minute: https://epr.elastic.co/search?prerelease=true&type=input We will also want to make sure we are happy with the upgrade path from integration package to input package (which #149423 related to). |
@hop-dev: There are 2 input packages available in the technical preview currently. I suppose one of these can be picked up to do the testing. |
The main question from my side around going GA is, do we expect any future breaking changes or only addition of features? As mentioned b @hop-dev , the upgrade path is important as we built too many non-input packages. @ishleenk17 Lets make sure we continue the detailed testing on input packages to uncover any potential issues. Which one we pick, no strong opinion on my ned. But lets pick one with decent compexity. |
@kpollich @joshdover are we ok to close this as done? |
Yes. Closing. |
Meta issue: elastic/package-spec#319
Spec changes: elastic/package-spec#328
We're adding support for a new type of package, called an input package, which is distinct from an integration package. Packages will have a new
type
field in theirmanifest.yml
which indicates if they're anintegration
orinput
package.There are several changes required in the Integration UX and package installation code to support this. To this end, we'll aim to take a phased approach here. We should first focus on unblocking integration developers from creating new input type packages and migrating existing integration type packages to input type packages. Then, we should focus on ensuring the "upgrade" path for migrated integration type packages is stable. Finally, we'll work on UX changes and enhancement within the policy editor and elsewhere in the Fleet/Integrations UI to improve the experience around input type packages.
🗺️ Phases
✅ Phase 1 - Support new
input
packages (Done)Child issue: #137750
type: input
data_stream.dataset
variable definition in its package spec in order to facilitate ingest customization✅ Phase 2 - Support upgrades from
integration
packages toinput
packages (Done)Child issue: #137751
type: integration
totype: input
data_stream.dataset
variable will be added to these packages in these updated versions. If a user changes the dataset using this variable, they'll need to follow the same manual process mentioned above to customize ingest. We don't need to do any kind of intelligent "migration" of ingest customizations during upgrades at this time.🎨 Phase 3- UI/UX Enhancements in support of
input
packages (Unstarted)Policy editor UI
Child issue: #145903
type: input
, display thedataset
form field for thedata_stream.dataset
variable as a "top-level" fielddataset
input is pre-populated with all existing datasets. Each dropdown option is of the format<type>-<dataset>
, default dropdown value isgeneric
Data streams
tab - specifically thedataset
column of the listing table on this tab.type
as the selected integration appear at the top of the listlog
integration, options that begin withlog-*
should appear firstFigma Screenshots
Ingest customization components
Child issue: #145529
{type}-{dataset} that matches on an index pattern of
{type}-{dataset}-*`{type}-{dataset}-{package-version}
_meta
value?Future proofing
output_permissions
list in the agent policy sent to Fleet Server includes the configured datasettype: integration
, set thedata_stream.dataset
field value via a hidden input❓ Open Questions
The text was updated successfully, but these errors were encountered: