diff --git a/model/fingerprinting.go b/model/fingerprinting.go index efdd64fa8..ae2593dc1 100644 --- a/model/fingerprinting.go +++ b/model/fingerprinting.go @@ -94,7 +94,7 @@ func NewFingerprintFromMetric(metric Metric) (f Fingerprint) { firstCharacterOfFirstLabelName = labelName[0:1] } if i == labelLength-1 { - lastCharacterOfLastLabelValue = string(labelValue[labelValueLength-2 : labelValueLength-1]) + lastCharacterOfLastLabelValue = string(labelValue[labelValueLength-1 : labelValueLength]) } summer.Write([]byte(labelName)) diff --git a/model/metric_test.go b/model/metric_test.go index ac72b2a51..44d2f0f47 100644 --- a/model/metric_test.go +++ b/model/metric_test.go @@ -35,9 +35,16 @@ func testMetric(t test.Tester) { "occupation": "robot", "manufacturer": "westinghouse", }, - rowkey: "04776841610193542734-f-56-o", + rowkey: "04776841610193542734-f-56-t", hash: 4776841610193542734, }, + { + input: map[string]string{ + "x": "y", + }, + rowkey: "01306929544689993150-x-2-y", + hash: 1306929544689993150, + }, } for i, scenario := range scenarios {