Default to flamegraph (#56733)

This commit is contained in:
Joey Tawadrous 2022-10-12 13:39:08 +01:00 committed by GitHub
parent 7c10082c57
commit 78061260fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -114,6 +114,7 @@ describe('addPanelToDashboard', () => {
${'logsFrames'} | ${'logs'}
${'graphFrames'} | ${'timeseries'}
${'nodeGraphFrames'} | ${'nodeGraph'}
${'flameGraphFrames'} | ${'flamegraph'}
${'traceFrames'} | ${'traces'}
`(
'Sets visualization to $expectedPanel if there are $frameType frames',

View File

@ -63,8 +63,10 @@ const hasRefId = (refId: DataFrame['refId']) => (frame: DataFrame) => frame.refI
function getPanelType(queries: DataQuery[], queryResponse: ExplorePanelData) {
for (const { refId } of queries.filter(isVisible)) {
// traceview is not supported in dashboards, skipping it for now.
const hasQueryRefId = hasRefId(refId);
if (queryResponse.flameGraphFrames.some(hasQueryRefId)) {
return 'flamegraph';
}
if (queryResponse.graphFrames.some(hasQueryRefId)) {
return 'timeseries';
}