diff --git a/prometheus/counter_test.go b/prometheus/counter_test.go index 40ba4278b..9398e288c 100644 --- a/prometheus/counter_test.go +++ b/prometheus/counter_test.go @@ -16,6 +16,7 @@ package prometheus import ( "fmt" "math" + "strings" "testing" "time" @@ -262,10 +263,11 @@ func TestCounterExemplar(t *testing.T) { err = e.(error) } }() - // Should panic because of 65 runes. + // Should panic because of 129 runes. counter.AddWithExemplar(42, Labels{ "abcdefghijklmnopqrstuvwxyz": "26+16 characters", "x1234567": "8+15 characters", + "z": strings.Repeat("x", 63), }) return nil } diff --git a/prometheus/value.go b/prometheus/value.go index 2dfa65991..2d3abc1cb 100644 --- a/prometheus/value.go +++ b/prometheus/value.go @@ -200,7 +200,7 @@ func MakeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair { } // ExemplarMaxRunes is the max total number of runes allowed in exemplar labels. -const ExemplarMaxRunes = 64 +const ExemplarMaxRunes = 128 // newExemplar creates a new dto.Exemplar from the provided values. An error is // returned if any of the label names or values are invalid or if the total