You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-27 22:49:15 +02:00
Allow '/' character in instrument names (#4501)
* Allow '/' character in instrument names * Add changelog * Update CHANGELOG.md Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> --------- Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
@@ -28,7 +28,7 @@ import (
|
||||
|
||||
var (
|
||||
// ErrInstrumentName indicates the created instrument has an invalid name.
|
||||
// Valid names must consist of 255 or fewer characters including alphanumeric, _, ., -, and start with a letter.
|
||||
// Valid names must consist of 255 or fewer characters including alphanumeric, _, ., -, / and start with a letter.
|
||||
ErrInstrumentName = errors.New("invalid instrument name")
|
||||
)
|
||||
|
||||
@@ -262,8 +262,8 @@ func validateInstrumentName(name string) error {
|
||||
return nil
|
||||
}
|
||||
for _, c := range name[1:] {
|
||||
if !isAlphanumeric(c) && c != '_' && c != '.' && c != '-' {
|
||||
return fmt.Errorf("%w: %s: must only contain [A-Za-z0-9_.-]", ErrInstrumentName, name)
|
||||
if !isAlphanumeric(c) && c != '_' && c != '.' && c != '-' && c != '/' {
|
||||
return fmt.Errorf("%w: %s: must only contain [A-Za-z0-9_.-/]", ErrInstrumentName, name)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user