Tempo: Tempo/Prometheus links select ds in new tab (cmd + click) (#52319)

* Set tempo/prom ds name when clicking trace links

* Updated tests

* Removed vars
This commit is contained in:
Joey Tawadrous
2022-07-18 15:36:16 +01:00
committed by GitHub
parent 7b7b9ff4a7
commit 6c89bf53f2
2 changed files with 17 additions and 8 deletions

View File

@@ -578,6 +578,14 @@ const backendSrvWithPrometheus = {
}
throw new Error('unexpected uid');
},
getDataSourceSettingsByUid(uid: string) {
if (uid === 'prom') {
return { name: 'Prometheus' };
} else if (uid === 'gdev-tempo') {
return { name: 'Tempo' };
}
return '';
},
};
function setupBackendSrv(frame: DataFrame) {
@@ -598,7 +606,7 @@ function setupBackendSrv(frame: DataFrame) {
const defaultSettings: DataSourceInstanceSettings<TempoJsonData> = {
id: 0,
uid: '0',
uid: 'gdev-tempo',
type: 'tracing',
name: 'tempo',
access: 'proxy',
@@ -777,7 +785,7 @@ const serviceGraphLinks = [
queryType: 'nativeSearch',
serviceName: '${__data.fields[0]}',
} as TempoQuery,
datasourceUid: 'tempo',
datasourceUid: 'gdev-tempo',
datasourceName: 'Tempo',
},
},