[APM][OTel] Fix layers issue for ESQL visualization by adding textBased layers (#216358)

Closes #215675  

## Summary

This PR fixes the issue with the ESQL visualization by supporting
`textBased` layers. For testing, there is a link to the serverless env
of this PR and it should be tested EDOT Java SDK as shown in [the
screenshot in this
comment](https://github.com/elastic/kibana/pull/216358#pullrequestreview-2728718952)

---------

Co-authored-by: Jonas Kunz <j+github@kunzj.de>
This commit is contained in:
jennypavlova 2025-04-07 15:20:12 +02:00 committed by GitHub
parent 129b1502ec
commit 523fa7689c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View file

@ -14,6 +14,7 @@ export const existingDashboardFileNames = new Set([
'classic_apm-otel_other-dotnet',
'classic_apm-edot-nodejs',
'classic_apm-edot-java',
'otel_native-edot-java',
'classic_apm-edot-dotnet',
'otel_native-edot-python',
'otel_native-edot-nodejs',
@ -61,6 +62,12 @@ export async function loadDashboardFile(filename: string) {
'./opentelemetry_java.json'
);
}
case 'otel_native-edot-java': {
return import(
/* webpackChunkName: "lazyJavaOtelNativeEdotDashboard" */
'./otel_native-edot-java.json'
);
}
case 'classic_apm-edot-dotnet': {
return import(
/* webpackChunkName: "lazyDotnetOtelNativeDashboard" */

View file

@ -61,11 +61,8 @@ export async function convertSavedDashboardToPanels(
const { gridData, embeddableConfig, panelIndex, title } = panel;
const { attributes } = embeddableConfig;
const { state } = attributes;
const {
datasourceStates: {
formBased: { layers },
},
} = state;
const layers =
state.datasourceStates?.formBased?.layers ?? state.datasourceStates?.textBased?.layers ?? [];
acc[gridData.i] = {
type: panel.type,