You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During a dashboard demo presented by @lucian-ioan yesterday, he mentioned some limitations where data views are not getting exported properly.
So out of curiosity, started investigating the issue and examining how the export and import of dashboards are handled, I noticed that the Elastic Package (EP) is using the deprecated export dashboard API to export dashboards. The recommended approach is to use the generic Saved Objects export API, where the dashboard is one of the objects. The recommended API details are as follows:
Recommended API
HTTP Method: POST
API: /api/saved_objects/_export
Request body: {"objects":[{"id":"","type":"dashboard"}],"includeReferencesDeep":true}
I also observed that the export functionality in the Kibana UI is using the recommended API, as evident from the Chrome Dev Tools Network Tab.
However, when using EP's export dashboard functionality, the above-mentioned data-view was not included in the exported dashboard JSON, which explains why data views have to be manually created?
It's worth noting that the response of the new API is in NDJSON format. I took a look at the Kibana codebase, and it seems like it should work as I checked the parts of the installation of packages in fleet plugin; but I'm not an expert in TypeScript, so I cannot say with certainty if they using the saved objects import API.
We would like to open a discussion on whether we should migrate to the new Saved Objects API in EP for exporting dashboards. Should we?
The text was updated successfully, but these errors were encountered:
During a dashboard demo presented by @lucian-ioan yesterday, he mentioned some limitations where data views are not getting exported properly.
So out of curiosity, started investigating the issue and examining how the export and import of dashboards are handled, I noticed that the Elastic Package (EP) is using the deprecated export dashboard API to export dashboards. The recommended approach is to use the generic Saved Objects export API, where the dashboard is one of the objects. The recommended API details are as follows:
See (EP using deprecated API):
elastic-package/internal/kibana/dashboards.go
Line 36 in 3957a10
I also observed that the export functionality in the Kibana UI is using the recommended API, as evident from the Chrome Dev Tools Network Tab.
Furthermore, I found a reference to the new API being used in the Beats repository: https://github.com/elastic/beats/blob/4496e21d4aeaa7d409a7c32eb68477ea630a1ce4/libbeat/dashboards/get.go#L48-L48
To reproduce the issue, I created a data view that points to
logs-*,metrics-*
and used it in the dashboard. The data view JSON is as follows:However, when using EP's export dashboard functionality, the above-mentioned data-view was not included in the exported dashboard JSON, which explains why data views have to be manually created?
It's worth noting that the response of the new API is in NDJSON format. I took a look at the Kibana codebase, and it seems like it should work as I checked the parts of the installation of packages in fleet plugin; but I'm not an expert in TypeScript, so I cannot say with certainty if they using the saved objects import API.
We would like to open a discussion on whether we should migrate to the new Saved Objects API in EP for exporting dashboards. Should we?
The text was updated successfully, but these errors were encountered: