Original comment by @ppf2:
Reproducible on v6 as well.
The profile api appears to produce output that uses the new 3 quote notation (see below).
"description": """MatchNoDocsQuery("empty BooleanQuery")""",
But the profiler UI considers this bad syntax:
Bad object [SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 1363 column 34 of the JSON data]
To workaround this, I had to manually modify the output to remove all the 3-quote notation to get it to work.
"description": "MatchNoDocsQuery(\"empty BooleanQuery\")",
The profiler UI should support the response syntax used by the profile api without requiring users to manually edit the output.
Reproducible on 7.0.0 as well.
Pinging @elastic/es-ui
Seems still affecting 7.2.0
Thanks @geekpete! Would you mind providing steps to reproduce?
In Dev Tools --> Console do:
GET /_search
{
"profile": "true"
}
Then copy the full output of this then go to Dev Tools --> Search Profiler,
Select all and paste over the default match all query input text and hit the Profile button.
You should hit an error at the first line with triple quotes with something like JSON.parse: expected ',' or '}' after property value in object
Ah, thanks! https://github.com/elastic/kibana/pull/39114 added the ability to disable triple quotes in the output pane. I was able to use this setting to generate output that is copy/pasteable into Search Profiler without this error. This will ship with 7.3
I'm going to close this because I believe this addresses the issue but we can reopen if you think there's more to it.
Thanks so much for the fix, this is greatly appreciated!
Any scope for an ability to strip triple quotes out if pasting profile outputs generated in previous versions so that they're still loadable in the Search Profiler? ie to simply reverse the process used to convert to the triple quotes format so that it's first converted back to valid json before it is to be profiled?
Any scope for an ability to strip triple quotes out if pasting profile outputs generated in previous versions so that they're still loadable in the Search Profiler?
Based on my new understanding about this workflow, I'm going to reopen this issue. We absolutely should add this sanitization/conversion step to Search Profiler to make it easier to use with any query that contains triple quotes.
This is so awesome! Thanks for fixing this one.