Skip to content
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

[Ingest Manager] Ensure installation of index-pattern assets from packages works #71633

Closed
skh opened this issue Jul 14, 2020 · 12 comments · Fixed by #77515
Closed

[Ingest Manager] Ensure installation of index-pattern assets from packages works #71633

skh opened this issue Jul 14, 2020 · 12 comments · Fixed by #77515
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@skh
Copy link
Contributor

skh commented Jul 14, 2020

Currently, we set up KibanaAssetType as

enum KibanaAssetType {
  dashboard = 'dashboard',
  visualization = 'visualization',
  search = 'search',
  indexPattern = 'index-pattern',
  map = 'map',
}

In

we check parts.type in KibanaAssetType, which will fail if parts.type is index-pattern, which it is because the kibana asset directories in packages are currently named like their saved objects type.

This code was never used for installing index patterns, as we currently don't have pre-generated index patterns in any of the packages. Still, if we support that asset type, installation should work.

This task is to clean up the code, make sure it works, and add an integration test. Also note that for elasticsearch assets, the package directory use snake_case now, so maybe the kibana assets should too. (see elastic/package-registry#572)

(Thanks @crob611 for spotting the problem.)

@skh skh added bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team labels Jul 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@crob611
Copy link
Contributor

crob611 commented Jul 14, 2020

Also want to mention that if changing the assets folders to be snake_case, that resulting parts.type is used as the type on the object when using getObject which will not match the kebab-case type that saved objects have, index-pattern or canvas-workpad-template as examples.

@ph
Copy link
Contributor

ph commented Aug 17, 2020

@neptunian Did we make any progress on this?

@neptunian
Copy link
Contributor

neptunian commented Aug 18, 2020

@ph No this has not been addressed. I'm not too worried about index patterns as we don't currently support pre-generated index patterns, though we do need a general solution for kibana assets wish dashes to make sure they are installed correctly. Since we don't yet support assets in the package with this issue, this is probably not high priority until then.

@ph
Copy link
Contributor

ph commented Aug 18, 2020

@neptunian thanks

@jonathan-buttner do you still need that feature for endpoint?

@crob611
Copy link
Contributor

crob611 commented Aug 18, 2020

@neptunian The Canvas team would like to be able to install our templates into Kibana through the package manager and this would block us. I'm happy to to do the work here if needed.

@neptunian
Copy link
Contributor

@crob611 Ah, I see.
@ph We should come up with a general solution dealing with this issue then. If @crob611 wants to do it, that's fine with me :)

@ruflin
Copy link
Member

ruflin commented Aug 19, 2020

@crob611 Would be great if you could take care of this. I suggest we create an issue in Kibana and package spec around adding canvas so everyone is aware of and we can discuss the "caveats". I filed this issue here to come up with a potential checklist: elastic/package-spec#27 @crob611 Could you file an issue?

@crob611
Copy link
Contributor

crob611 commented Aug 20, 2020

Alright, I'm going to fix this in order to get our canvas types allowable.

My question: is there a reason to even maintain the KibanaAssetType, or should we just assume everything in the kibana directory is an asset that should be installed? My concern is that only installing assets from some list we maintain would require a release to add new asset types to a package.

Any thoughts on going about it this way? I obviously don't have the historical context on any of this, so appreciate any input you can share.

@ruflin
Copy link
Member

ruflin commented Aug 21, 2020

What asset types we support is also documented in our package-spec: https://github.com/elastic/package-spec I think it is important that we don't just install all the assets showing up in a package. Each new assets type, we should test if it works and we need to have a discussion on how it behaves (see checklist in elastic/package-spec#27). I personally think we should even have all the CRUD methods specified for each asset type and only reuse logic from lib. That dashboards, visualizations and canvas potentially work the same is in the future more the exception I believe.

@jonathan-buttner
Copy link
Contributor

@neptunian thanks

@jonathan-buttner do you still need that feature for endpoint?

We don't currently need this for endpoint. The reason I was investigating installing our own index patterns was to make certain visualizations have their axes have a custom label. For example, have a Y-axis be labeled with GB instead of 10000...

@jonathan-buttner
Copy link
Contributor

@crob611 we might need to make some of the kibana side changes I outlined in this issue: #70864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants