diff --git a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/action/StackTrace.java b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/action/StackTrace.java index 0be6d91450eda..5c9b589b4ec38 100644 --- a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/action/StackTrace.java +++ b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/action/StackTrace.java @@ -184,7 +184,15 @@ static String getFileIDFromStackFrameID(String frameID) { public static StackTrace fromSource(Map source) { String inputFrameIDs = ObjectPath.eval(PATH_FRAME_IDS, source); + if (inputFrameIDs == null) { + // If synthetic source is disabled, fallback to dotted field names. + inputFrameIDs = (String) source.get("Stacktrace.frame.ids"); + } String inputFrameTypes = ObjectPath.eval(PATH_FRAME_TYPES, source); + if (inputFrameTypes == null) { + // If synthetic source is disabled, fallback to dotted field names. + inputFrameTypes = (String) source.get("Stacktrace.frame.types"); + } int countsFrameIDs = inputFrameIDs.length() / BASE64_FRAME_ID_LENGTH; String[] fileIDs = new String[countsFrameIDs]; diff --git a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/action/TransportGetStackTracesAction.java b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/action/TransportGetStackTracesAction.java index 60b2df08206d3..34db0cebe6077 100644 --- a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/action/TransportGetStackTracesAction.java +++ b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/action/TransportGetStackTracesAction.java @@ -788,7 +788,12 @@ public void onExecutableDetailsResponse(MultiGetResponse multiGetItemResponses) if (executable.getResponse().isExists()) { // Duplicates are expected as we query multiple indices - do a quick pre-check before we deserialize a response if (executables.containsKey(executable.getId()) == false) { - String fileName = ObjectPath.eval(PATH_FILE_NAME, executable.getResponse().getSource()); + Map source = executable.getResponse().getSource(); + String fileName = ObjectPath.eval(PATH_FILE_NAME, source); + if (fileName == null) { + // If synthetic source is disabled, read from dotted field names. + fileName = (String) source.get("Executable.file.name"); + } if (fileName != null) { executables.putIfAbsent(executable.getId(), fileName); } else {