Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ShardLabel is a reserved label referencing a cortex shard ShardLabel = "__cortex_shard__" // ShardLabelFmt is the fmt of the ShardLabel key. ShardLabelFmt = "%d_of_%d" )
Variables ¶
View Source
var ShardLabelRE = regexp.MustCompile("^[0-9]+_of_[0-9]+$")
ShardLabelRE matches a value in ShardLabelFmt
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
Annotation is a convenience struct which holds data from a parsed shard label
func FromMatchers ¶
func FromMatchers(matchers []*labels.Matcher) (shard *Annotation, idx int, err error)
FromMatchers extracts a ShardAnnotation and the index it was pulled from in the matcher list
func ParseShard ¶
func ParseShard(input string) (parsed Annotation, err error)
ParseShard will extract the shard information encoded in ShardLabelFmt
func (Annotation) Label ¶
func (shard Annotation) Label() labels.Label
Label generates the ShardAnnotation as a label
func (Annotation) Match ¶
func (shard Annotation) Match(fp model.Fingerprint) bool
func (Annotation) String ¶
func (shard Annotation) String() string
String encodes a shardAnnotation into a label value
func (Annotation) TSDB ¶
func (shard Annotation) TSDB() index.ShardAnnotation
Click to show internal directories.
Click to hide internal directories.