mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
stackdriver: make it possible to use metric type template variable
This commit is contained in:
parent
4569527873
commit
20f1956225
@ -139,7 +139,7 @@ export class StackdriverFilterCtrl {
|
|||||||
result = metrics.filter(m => m.service === this.target.service);
|
result = metrics.filter(m => m.service === this.target.service);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.find(m => m.value === this.target.metricType)) {
|
if (result.find(m => m.value === this.templateSrv.replace(this.target.metricType))) {
|
||||||
this.metricType = this.target.metricType;
|
this.metricType = this.target.metricType;
|
||||||
} else if (result.length > 0) {
|
} else if (result.length > 0) {
|
||||||
this.metricType = this.target.metricType = result[0].value;
|
this.metricType = this.target.metricType = result[0].value;
|
||||||
@ -187,7 +187,9 @@ export class StackdriverFilterCtrl {
|
|||||||
|
|
||||||
setMetricType() {
|
setMetricType() {
|
||||||
this.target.metricType = this.metricType;
|
this.target.metricType = this.metricType;
|
||||||
const { valueType, metricKind, unit } = this.metricDescriptors.find(m => m.type === this.target.metricType);
|
const { valueType, metricKind, unit } = this.metricDescriptors.find(
|
||||||
|
m => m.type === this.templateSrv.replace(this.metricType)
|
||||||
|
);
|
||||||
this.target.unit = unit;
|
this.target.unit = unit;
|
||||||
this.target.valueType = valueType;
|
this.target.valueType = valueType;
|
||||||
this.target.metricKind = metricKind;
|
this.target.metricKind = metricKind;
|
||||||
|
Loading…
Reference in New Issue
Block a user