Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ShardLabel is a reserved label referencing a shard on read path. ShardLabel = "__query_shard__" // CompactorShardIDLabel is the external label used to store // the ID of a sharded block generated by the split-and-merge compactor. If a block hasn't // this label, it means the block hasn't been split. CompactorShardIDLabel = "__compactor_shard_id__" )
Variables ¶
This section is empty.
Functions ¶
func FormatShardIDLabelValue ¶
FormatShardIDLabelValue expects 0-based shardID, but uses 1-based shard in the output string.
func ParseShardIDLabelValue ¶
ParseShardIDLabelValue returns original (0-based) shard index and shard count parsed from formatted value.
Types ¶
type ShardSelector ¶
ShardSelector holds information about the configured query shard.
func RemoveShardFromMatchers ¶
func RemoveShardFromMatchers(matchers []*labels.Matcher) (shard *ShardSelector, filtered []*labels.Matcher, err error)
RemoveShardFromMatchers returns the input matchers without the label matcher on the query shard (if any).
func ShardFromMatchers ¶
func ShardFromMatchers(matchers []*labels.Matcher) (shard *ShardSelector, idx int, err error)
ShardFromMatchers extracts a ShardSelector and the index it was pulled from the matcher list.
func (ShardSelector) Label ¶
func (shard ShardSelector) Label() labels.Label
Label generates the ShardSelector as a label.
func (ShardSelector) LabelValue ¶
func (shard ShardSelector) LabelValue() string
LabelValue returns the label value to use to select this shard.
func (ShardSelector) Matcher ¶
func (shard ShardSelector) Matcher() *labels.Matcher
Matcher converts ShardSelector to Matcher.
Click to show internal directories.
Click to hide internal directories.