Merge pull request #9210 from ioito/hotfix/qx-azure-metric

fix(region): azure metric request path
This commit is contained in:
Zexi Li
2020-12-04 18:00:47 +08:00
committed by GitHub
+2 -2
View File
@@ -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 {