Skip to content

Commit 2c526fc

Browse files
authored
[APM][Metrics] Allow text panels in the metric dashboards (elastic#224426)
Closes elastic#224425 ## Summary This PR adds support for the text panel in the APM dashboards inside the metrics tab ## Testing ⚠️ UPDATE: The dashboard won't be part of the PR so ⬇️ won't work now - with connection to edge oblt cluster: - Open Applications > Service Inventory and click on the `cart` (or any EDOT .NET service) service - Go to the metrics tab - The dashboard should be visible ![image](https://github.com/user-attachments/assets/58082514-7e10-4758-adcf-069b4b9a2109)
1 parent d3f6fb9 commit 2c526fc

File tree

1 file changed

+3
-4
lines changed
  • x-pack/solutions/observability/plugins/apm/public/components/app/metrics/static_dashboard

1 file changed

+3
-4
lines changed

x-pack/solutions/observability/plugins/apm/public/components/app/metrics/static_dashboard/helper.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ export async function convertSavedDashboardToPanels(
6060
const panels = panelsRawObjects.reduce((acc, panel) => {
6161
const { gridData, embeddableConfig, panelIndex, title } = panel;
6262
const { attributes } = embeddableConfig;
63-
const { state } = attributes;
64-
const layers =
65-
state.datasourceStates?.formBased?.layers ?? state.datasourceStates?.textBased?.layers ?? [];
63+
const datasourceStates = attributes?.state?.datasourceStates ?? {};
64+
const layers = datasourceStates.formBased?.layers ?? datasourceStates.textBased?.layers ?? [];
6665

6766
acc[gridData.i] = {
6867
type: panel.type,
@@ -75,7 +74,7 @@ export async function convertSavedDashboardToPanels(
7574
...attributes,
7675
references: [],
7776
state: {
78-
...state,
77+
...(attributes?.state ?? {}),
7978
adHocDataViews: getAdhocDataView(dataView),
8079
internalReferences: Object.keys(layers).map((layerId) => ({
8180
id: dataView.id,

0 commit comments

Comments
 (0)