File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
pkg/agent/sysadvisor/plugin/metric-emitter/syncer/node Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package node
1919import (
2020 "context"
2121 "fmt"
22+ "strconv"
2223 "time"
2324
2425 v1 "k8s.io/api/core/v1"
@@ -185,23 +186,24 @@ func (n *MetricSyncerNode) generateMetricTag(ctx context.Context) (tags []metric
185186 cpuCodeName = ""
186187 }
187188
189+ tags = append (tags , metrics.MetricTag {
190+ Key : fmt .Sprintf ("%s%s" , data .CustomMetricLabelSelectorPrefixKey , "cpu_codename" ),
191+ Val : cpuCodeName ,
192+ })
193+
188194 // append vendor info
189- vendor := ""
195+ isVM := ""
190196 isVMInterface := n .metaServer .MetricsFetcher .GetByStringIndex (consts .MetricInfoIsVM )
191- isVM , ok := isVMInterface .(bool )
197+ isVMBool , ok := isVMInterface .(bool )
192198 if ! ok {
193199 klog .Warningf ("parse is vm %v failed" , isVMInterface )
194200 } else {
195- if isVM {
196- vendor = "vm"
197- } else {
198- vendor = "bm"
199- }
201+ isVM = strconv .FormatBool (isVMBool )
200202 }
201203
202204 tags = append (tags , metrics.MetricTag {
203- Key : fmt .Sprintf ("%s%s" , data .CustomMetricLabelSelectorPrefixKey , "node_model " ),
204- Val : fmt . Sprintf ( "%s-%s" , cpuCodeName , vendor ) ,
205+ Key : fmt .Sprintf ("%s%s" , data .CustomMetricLabelSelectorPrefixKey , "is_vm " ),
206+ Val : isVM ,
205207 })
206208
207209 // append node numa bit mask
You can’t perform that action at this time.
0 commit comments