Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/pkg/loghttp/versions.go

23 lines
376 B

package loghttp
import (
"strings"
)
// Version holds a loghttp version
type Version int
// Valid Version values
const (
VersionLegacy = Version(iota)
VersionV1
)
// GetVersion returns the loghttp version for a given path.
func GetVersion(uri string) Version {
if strings.Contains(strings.ToLower(uri), "/loki/api/v1") {
return VersionV1
}
return VersionLegacy
}