Skip to content

Commit

Permalink
fixup! Update metrics/registry.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Nov 15, 2023
1 parent 111643a commit 498222e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/tests/cmd_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ func TestMetricNameError(t *testing.T) {
t.Log(stdout)

logEntries := ts.LoggerHook.Drain()
expectedMsg := `Metric name should only include up to 128 ASCII letters, numbers and/or underscores.`
expectedMsg := `Metric names must only include up to 128 ASCII letters, numbers, or underscores`
filteredEntries := testutils.FilterEntries(logEntries, logrus.ErrorLevel, expectedMsg)
require.Len(t, filteredEntries, 1)
require.Contains(t, filteredEntries[0].Message, "'test counter'")
Expand Down
3 changes: 2 additions & 1 deletion metrics/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func NewRegistry() *Registry {

const (
nameRegexString = "^[a-zA-Z_][a-zA-Z0-9_]{1,128}$"
badNameWarning = "Metric names should start with a letter or an underscore and only include up to 128 ASCII letters, numbers, or underscores."
badNameWarning = "Metric names must only include up to 128 ASCII letters, numbers, or underscores " +
"and start with a letter or an underscore."
)

var compileNameRegex = regexp.MustCompile(nameRegexString)
Expand Down

0 comments on commit 498222e

Please sign in to comment.