metric 키 계산 수정
This commit is contained in:
@ -144,6 +144,10 @@ func init() {
|
|||||||
func newMetricImpl(mt MetricType, name string, help string, constLabels map[string]string) (writer MetricWriter) {
|
func newMetricImpl(mt MetricType, name string, help string, constLabels map[string]string) (writer MetricWriter) {
|
||||||
hash := md5.New()
|
hash := md5.New()
|
||||||
hash.Write([]byte(name))
|
hash.Write([]byte(name))
|
||||||
|
for k, v := range constLabels {
|
||||||
|
hash.Write([]byte(k))
|
||||||
|
hash.Write([]byte(v))
|
||||||
|
}
|
||||||
|
|
||||||
key := hex.EncodeToString(hash.Sum(nil))[:metric_key_size]
|
key := hex.EncodeToString(hash.Sum(nil))[:metric_key_size]
|
||||||
temp, _ := json.Marshal(MetricDescription{
|
temp, _ := json.Marshal(MetricDescription{
|
||||||
|
|||||||
Reference in New Issue
Block a user