diff --git a/public/app/plugins/datasource/tempo/ServiceGraphSection.tsx b/public/app/plugins/datasource/tempo/ServiceGraphSection.tsx
index 53bba555f23..fc174bf971d 100644
--- a/public/app/plugins/datasource/tempo/ServiceGraphSection.tsx
+++ b/public/app/plugins/datasource/tempo/ServiceGraphSection.tsx
@@ -53,15 +53,18 @@ export function ServiceGraphSection({
const ds = dsState.value as PrometheusDatasource;
if (!graphDatasourceUid) {
- return
Please set up a service graph datasource in the datasource settings.
;
+ return getWarning(
+ 'No service graph datasource selected',
+ 'Please set up a service graph datasource in the datasource settings',
+ styles
+ );
}
if (graphDatasourceUid && !ds) {
- return (
-
- Service graph datasource is configured but the data source no longer exists. Please configure existing data
- source to use the service graph functionality.
-
+ return getWarning(
+ 'No service graph data found',
+ 'Service graph datasource is configured but the data source no longer exists. Please configure existing data source to use the service graph functionality',
+ styles
);
}
@@ -101,24 +104,34 @@ export function ServiceGraphSection({
/>
- {hasKeys === false ? (
-
- Please ensure that service graph metrics are set up correctly according to the{' '}
-
- Tempo documentation
-
- .
-
- ) : null}
+ {hasKeys === false
+ ? getWarning(
+ 'No service graph data found',
+ 'Please ensure that service graph metrics are set up correctly',
+ styles
+ )
+ : null}
);
}
+function getWarning(title: string, description: string, styles: { alert: string; link: string }) {
+ return (
+
+ {description} according to the{' '}
+
+ Tempo documentation
+
+ .
+
+ );
+}
+
function queryToFilter(query: string): AdHocVariableFilter[] {
let match;
let filters: AdHocVariableFilter[] = [];