opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.69k stars 893 forks source link

[Feature] Adding `metadata` attributes to the `savedObject` interface #4553

Open YANG-DB opened 1 year ago

YANG-DB commented 1 year ago

Is your feature request related to a problem? Please describe. When I create a dashboard, I would like to associate it with multiple aspects:

I would like to do this in the most generic and dynamic way so that future usage may by possible without limitation or code changes. This generic labels (tags) mechanisms are very common in other dashboards like tools and utilities so that user can have a generic way of filtering / associating different dynamic notions without the need to explicitly write code...

Describe the solution you'd like

Adding metadata fields attribute list to the savedObject for the purpose of association of different labels and tags for any saved objects.

Using the existing SavedObjectsType and extending its interface with the generic metadata attribute list

Additional context

ashwin-pc commented 1 year ago

@YANG-DB thanks for opening this issue. Any service/plugin is free to create their own saved objects and saved object relationships are already a thing, did you consider just creating a new metadata saved object thats related to the dashboards saved object to store all this information? saved objects are already metadata that the plugin needs to function. If these tags are also going to be used by the same plugin to function, we can surely expand them, but if they are used strictly by other plugins, its better to make a separate saved object to store that information using relationships.

That being said this is an interesting idea and would like to know more about what you are trying to achieve here. Is there a specific problem that you are trying to solve for which this is a general solution?

YANG-DB commented 1 year ago

@ashwin-pc: labels / tagging enable you to organize your dashboards and other saved objects into meaningful categories. Once tagged you can filter only the dashboards and saved objects that belong to that tag.

Numerous use cases:

Existing Plugins use case:

ashwin-pc commented 1 year ago

Nice! yep that makes sense. Why extend SavedObjectsType instead of just adding it as an additional property to existing saved object though? Also is it an optional property? cause if its not it might be a breaking change to the exiting saved object definitions that dont have this property defined.