Source File
labels.go
Belonging Package
github.com/prometheus/common/model
package model
import (
)
AlertNameLabel = "alertname"
ExportedLabelPrefix = "exported_"
MetricNameLabel = "__name__"
SchemeLabel = "__scheme__"
AddressLabel = "__address__"
MetricsPathLabel = "__metrics_path__"
ReservedLabelPrefix = "__"
MetaLabelPrefix = "__meta_"
TmpLabelPrefix = "__tmp_"
ParamLabelPrefix = "__param_"
JobLabel = "job"
InstanceLabel = "instance"
BucketLabel = "le"
QuantileLabel = "quantile"
)
var LabelNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$")
type LabelNames []LabelName
func ( LabelNames) () int {
return len()
}
func ( LabelNames) (, int) bool {
return [] < []
}
func ( LabelNames) (, int) {
[], [] = [], []
}
func ( LabelNames) () string {
:= make([]string, 0, len())
for , := range {
= append(, string())
}
return strings.Join(, ", ")
}
type LabelValue string
func ( LabelValue) () bool {
return utf8.ValidString(string())
}
type LabelValues []LabelValue
func ( LabelValues) () int {
return len()
}
func ( LabelValues) (, int) bool {
return string([]) < string([])
}
func ( LabelValues) (, int) {
[], [] = [], []
}
type LabelPair struct {
Name LabelName
Value LabelValue
}
type LabelPairs []*LabelPair
func ( LabelPairs) () int {
return len()
}
func ( LabelPairs) (, int) bool {
switch {
case [].Name > [].Name:
return false
case [].Name < [].Name:
return true
case [].Value > [].Value:
return false
case [].Value < [].Value:
return true
default:
return false
}
}
func ( LabelPairs) (, int) {
[], [] = [], []
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |