Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise exemplar labels limit from 64 to 128 #1091

Merged
merged 1 commit into from Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion prometheus/counter_test.go
Expand Up @@ -16,6 +16,7 @@ package prometheus
import (
"fmt"
"math"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion prometheus/value.go
Expand Up @@ -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
Expand Down