(cloudwatch) custom metrics namespace support

This commit is contained in:
Mitsuhiro Tanda
2016-02-12 00:30:33 +09:00
parent 3b21e9fcf0
commit 81ad469533
2 changed files with 16 additions and 0 deletions
+5
View File
@@ -126,6 +126,11 @@ func handleGetNamespaces(req *cwRequest, c *middleware.Context) {
for key := range metricsMap {
keys = append(keys, key)
}
if customMetricsNamespaces, ok := req.DataSource.JsonData["customMetricsNamespaces"].(string); ok {
for _, key := range strings.Split(customMetricsNamespaces, ",") {
keys = append(keys, key)
}
}
sort.Sort(sort.StringSlice(keys))
result := []interface{}{}