[v9.5.x] Google Cloud Monitoring: Fix project variable (#66603)

Google Cloud Monitoring: Fix project variable (#66524)

Google Cloud Monitoring: fix project variable

Also fix typo found while debugging

(cherry picked from commit 02951e8a26)

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
This commit is contained in:
Grot (@grafanabot)
2023-04-14 15:29:44 +00:00
committed by GitHub
co-authored by Adam Simpson
parent 4cd346e66c
commit 1433fcb9b2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -645,7 +645,7 @@ func (s *Service) getDSInfo(pluginCtx backend.PluginContext) (*datasourceInfo, e
instance, ok := i.(*datasourceInfo)
if !ok {
return nil, fmt.Errorf("failed to cast datsource info")
return nil, fmt.Errorf("failed to cast datasource info")
}
return instance, nil
@@ -62,7 +62,7 @@ export class CloudMonitoringVariableQueryEditor extends PureComponent<Props, Var
async componentDidMount() {
await this.props.datasource.ensureGCEDefaultProject();
const projectName = this.props.datasource.getDefaultProject();
const projectName = this.props.query.projectName || this.props.datasource.getDefaultProject();
const projects = (await this.props.datasource.getProjects()) as MetricDescriptor[];
const metricDescriptors = await this.props.datasource.getMetricTypes(
this.props.query.projectName || this.props.datasource.getDefaultProject()