From 9c7145fd53c39c3c462a2933a50de75a8bcf8886 Mon Sep 17 00:00:00 2001 From: Qu Xuan Date: Fri, 4 Dec 2020 17:13:15 +0800 Subject: [PATCH] fix(region): azure metric request path --- pkg/multicloud/azure/monitor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/multicloud/azure/monitor.go b/pkg/multicloud/azure/monitor.go index b9f385ed9e..ca7e9177ee 100644 --- a/pkg/multicloud/azure/monitor.go +++ b/pkg/multicloud/azure/monitor.go @@ -85,7 +85,7 @@ type MetricValue struct { Count *float64 `json:"count,omitempty"` } -func (self *SRegion) GetMonitorData(name string, ns string, external_id string, since time.Time, +func (self *SRegion) GetMonitorData(name string, ns string, resourceId string, since time.Time, until time.Time) (*ResponseMetirc, error) { params := url.Values{} params.Set("metricnamespace", ns) @@ -96,7 +96,7 @@ func (self *SRegion) GetMonitorData(name string, ns string, external_id string, if !since.IsZero() && !until.IsZero() { params.Set("timespan", since.UTC().Format(time.RFC3339)+"/"+until.UTC().Format(time.RFC3339)) } - resource := fmt.Sprintf("%s/provider/microsoft.insights/metrics") + resource := fmt.Sprintf("%s/provider/microsoft.insights/metrics", resourceId) elements := ResponseMetirc{} err := self.get(resource, params, &elements) if err != nil {