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

Multiple references to the same index-pattern in a dashboard saved object #149105

Closed
MichaelKatsoulis opened this issue Jan 18, 2023 · 9 comments
Closed
Labels
enhancement New value added to drive a business result Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@MichaelKatsoulis
Copy link
Contributor

Kibana dashboards when created following the by value approach, save a lot of references of the same index pattern in the saved object json file.

references

Does this make sense? The share the same id metrics-*. So why not just one?

@MichaelKatsoulis MichaelKatsoulis added the bug Fixes for quality problems that affect the customer experience label Jan 18, 2023
@botelastic botelastic bot added the needs-team Issues missing a team label label Jan 18, 2023
@MichaelKatsoulis MichaelKatsoulis added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jan 18, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

@dej611
Copy link
Contributor

dej611 commented Jan 18, 2023

I think is mostly a @elastic/kibana-presentation issue, but it's more an optimization rather than a bug to me.
Each visualization is declaring its own references (as {name: <visualization_id>, etc...}) and the dashboard is moving them into a single references prop in the SO.

@dej611 dej611 added enhancement New value added to drive a business result Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas and removed bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Jan 18, 2023
@drewdaemon
Copy link
Contributor

I think the thing we want verified here is that all the data view references in the dashboard (you can see the full list here) are ultimately pointing at a single metrics-* data view. Is that right, @MichaelKatsoulis ?

@MichaelKatsoulis
Copy link
Contributor Author

@andrewctate Yes and if all those are pointing to the same id then why not just have one reference?

@drewdaemon
Copy link
Contributor

drewdaemon commented Jan 18, 2023

@MichaelKatsoulis, the presentation team is welcome to chime in, but since all the references point to the same data view with the id prop, you don't need to be concerned that there are more than one data view at play.

I assume that the reason there are multiple references is that it is simpler for the dashboard application to treat saved-object references within its panels as opaque. TBH, I'm not sure why it would be useful to optimize this.

@ThomThomson
Copy link
Contributor

@MichaelKatsoulis, the dashboard extracts all references from each panel on save. Each dashboard panel could potentially be associated with many references, and because there is a registry of embeddable types, we cannot predict how many references, or what type of references will be extracted.

For instance, some panels (by reference) contain references to the visualize library, there can be references to other dashboards stored in drilldowns, and there are of course there are plenty of data view references. We store each reference in the references array with their panel index in the name so that when a dashboard saved object is loaded, we can inject them back into the correct panel.

This system does result in duplication in cases where many panels have the same reference, but it hasn't caused any issues so we haven't felt the need to de-dupe. Is there currently an issue being caused by the way dashboard references are stored?

@MichaelKatsoulis
Copy link
Contributor Author

@ThomThomson it is not issue per se, it just looked strange to me that references with same id can be part of the dashboard if each one of them is not offering something new. I understand the need of multiple references of course in the list but not same ones.

If you believe that it is just a a necessary evil of the current implementation then we can close the issue.

@ThomThomson
Copy link
Contributor

It's not strictly necessary to keep it this way. With enough effort, references could be de-duped without losing the connection between the panel and the reference - but the question is "is this feature impactful enough to justify that effort"? And I haven't personally seen justification that says it is.

@ruflin
Copy link
Contributor

ruflin commented Jan 23, 2023

Thanks everyone for chiming in. My initial reaction was when I saw the list is, that there is a good chance that the same index pattern exists multiple times (an issue we had in the past). But it seems like it is not the case and more about internal management of references in saved objects. I don't think it is a requirement to improve this but this issue serves as a good documentation for this feature / behaviour as likely we are not the last integrations developers that have questions around it. I'm going to close this issue, lets reopen if needed.

@ruflin ruflin closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests

6 participants