Skip to content

Commit

Permalink
fix(monitor): support edit vm alarmpolices (#1919)
Browse files Browse the repository at this point in the history
Co-authored-by: willzgli <willzgli@tencent.com>
  • Loading branch information
willzgli and willzgli authored May 9, 2022
1 parent 770b35f commit c5aee4b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/monitor/services/rest/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const (
filterNamespaceKey = "namespace"
filterWorkloadKindKey = "workload_kind"
filterWorkloadNameKey = "workload_name"
filterWorkloadVMKey = "name"
measurementKey = "measurement"
valueKey = "value"
valueStr = "{{ $value }}"
Expand Down Expand Up @@ -458,6 +459,8 @@ func NewMetricFilterFromExpr(expr string) *MetricFilter {
filter.WorkloadKind = strings.Split(str, "\"")[1]
case strings.HasPrefix(str, filterWorkloadNameKey):
filter.WorkloadName = strings.Split(str, "\"")[1]
case strings.HasPrefix(str, filterWorkloadVMKey):
filter.WorkloadName = strings.Split(str, "\"")[1]
}
}
return filter
Expand Down

0 comments on commit c5aee4b

Please sign in to comment.