mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed alias in Cloudwatch Expressions
This commit is contained in:
parent
1478f38dd9
commit
8ef3aebc29
@ -496,9 +496,9 @@ func parseQuery(model *simplejson.Json) (*CloudWatchQuery, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
alias := model.Get("alias").MustString()
|
alias := model.Get("alias").MustString()
|
||||||
if alias == "" {
|
/*if alias == "" {
|
||||||
alias = "{{metric}}_{{stat}}"
|
alias = "{{metric}}_{{stat}}"
|
||||||
}
|
}*/
|
||||||
|
|
||||||
returnData := model.Get("returnData").MustBool(false)
|
returnData := model.Get("returnData").MustBool(false)
|
||||||
highResolution := model.Get("highResolution").MustBool(false)
|
highResolution := model.Get("highResolution").MustBool(false)
|
||||||
@ -521,8 +521,12 @@ func parseQuery(model *simplejson.Json) (*CloudWatchQuery, error) {
|
|||||||
|
|
||||||
func formatAlias(query *CloudWatchQuery, stat string, dimensions map[string]string) string {
|
func formatAlias(query *CloudWatchQuery, stat string, dimensions map[string]string) string {
|
||||||
if len(query.Id) > 0 && len(query.Expression) > 0 {
|
if len(query.Id) > 0 && len(query.Expression) > 0 {
|
||||||
|
if len(query.Alias) > 0 {
|
||||||
|
return query.Alias
|
||||||
|
} else {
|
||||||
return query.Id
|
return query.Id
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data := map[string]string{}
|
data := map[string]string{}
|
||||||
data["region"] = query.Region
|
data["region"] = query.Region
|
||||||
|
Loading…
Reference in New Issue
Block a user