草庐IT

labelsMap

全部标签

dictionary - 动态添加键值映射到结构

我想弄清楚如何将map[string]string的键值对添加到我的prometheus.Labels结构中。如果您有使用prometheus的经验:我正在尝试动态添加标签及其值。labelsMap:=make(map[string]string)labelsMap["nodepool"]="default"labelsMap["zone"]="europe-west"//hereI'dliketoaddmykey/valuepairsfrommymapcontainerLabels:=prometheus.Labels{"node":"nodename","container":"f

dictionary - 动态添加键值映射到结构

我想弄清楚如何将map[string]string的键值对添加到我的prometheus.Labels结构中。如果您有使用prometheus的经验:我正在尝试动态添加标签及其值。labelsMap:=make(map[string]string)labelsMap["nodepool"]="default"labelsMap["zone"]="europe-west"//hereI'dliketoaddmykey/valuepairsfrommymapcontainerLabels:=prometheus.Labels{"node":"nodename","container":"f