mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(monitor): wrong tag filter when get metric measurement
This commit is contained in:
@@ -658,7 +658,7 @@ func (self *SDataSourceManager) filterRtnTags(output *monitor.InfluxMeasurement)
|
||||
}
|
||||
for _, tag := range []string{"source", "status", hostconsts.TELEGRAF_TAG_KEY_HOST_TYPE,
|
||||
hostconsts.TELEGRAF_TAG_KEY_RES_TYPE, "is_vm", "os_type", hostconsts.TELEGRAF_TAG_KEY_PLATFORM,
|
||||
hostconsts.TELEGRAF_TAG_KEY_HYPERVISOR, "domain_name", "region"} {
|
||||
hostconsts.TELEGRAF_TAG_KEY_HYPERVISOR, "domain_name", "region", "ips", "vip", "vip_eip", "eip", "eip_mode"} {
|
||||
if _, ok := output.TagValue[tag]; ok {
|
||||
delete(output.TagValue, tag)
|
||||
}
|
||||
|
||||
@@ -121,7 +121,6 @@ func filterByScope(ctx context.Context, userCred mcclient.TokenCredential, scope
|
||||
projectId = userCred.GetProjectId()
|
||||
}
|
||||
return getProjectIdFilterByProject(projectId)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,12 +158,11 @@ func getProjectIdsFilterByDomain(domainId string) (string, error) {
|
||||
//}
|
||||
//buffer.WriteString(" )")
|
||||
//return buffer.String(), nil
|
||||
return fmt.Sprintf(`"%s" =~ /%s/`, "domain_id", domainId), nil
|
||||
|
||||
return fmt.Sprintf(`%s =~ /%s/`, "domain_id", domainId), nil
|
||||
}
|
||||
|
||||
func getProjectIdFilterByProject(projectId string) (string, error) {
|
||||
return fmt.Sprintf(`"%s" =~ /%s/`, "tenant_id", projectId), nil
|
||||
return fmt.Sprintf(`%s =~ /%s/`, "tenant_id", projectId), nil
|
||||
}
|
||||
|
||||
func (self *SUnifiedMonitorManager) GetPropertyMetricMeasurement(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
|
||||
Reference in New Issue
Block a user