|
|
|
@ -15,6 +15,7 @@ import { |
|
|
|
|
} from '@grafana/data'; |
|
|
|
|
import { DataQuery } from '@grafana/schema'; |
|
|
|
|
import { GraphThresholdsStyleMode, Icon, InlineField, Input, Tooltip, useStyles2, Stack } from '@grafana/ui'; |
|
|
|
|
import { logInfo } from 'app/features/alerting/unified/Analytics'; |
|
|
|
|
import { QueryEditorRow } from 'app/features/query/components/QueryEditorRow'; |
|
|
|
|
import { AlertDataQuery, AlertQuery } from 'app/types/unified-alerting-dto'; |
|
|
|
|
|
|
|
|
@ -82,6 +83,19 @@ export const QueryWrapper = ({ |
|
|
|
|
...cloneDeep(query.model), |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if (queryWithDefaults.datasource && queryWithDefaults.datasource?.uid !== query.datasourceUid) { |
|
|
|
|
logInfo('rule query datasource and datasourceUid mismatch', { |
|
|
|
|
queryModelDatasourceUid: queryWithDefaults.datasource?.uid || '', |
|
|
|
|
queryDatasourceUid: query.datasourceUid, |
|
|
|
|
datasourceType: query.model.datasource?.type || 'unknown type', |
|
|
|
|
}); |
|
|
|
|
// There are occasions when the rule query model datasource UID and the datasourceUid do not match
|
|
|
|
|
// It's unclear as to why this happens, but we need better visibility on why this happens,
|
|
|
|
|
// so we log when it does, and make the query model datasource UID match the datasource UID
|
|
|
|
|
// We already elsewhere work under the assumption that the datasource settings are fetched from the datasourceUid property
|
|
|
|
|
queryWithDefaults.datasource.uid = query.datasourceUid; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function SelectingDataSourceTooltip() { |
|
|
|
|
const styles = useStyles2(getStyles); |
|
|
|
|
return ( |
|
|
|
|