Documentation ¶
Overview ¶
Package logqlabels contains LogQL label utilities.
Index ¶
- type AggregatedLabels
- type GroupingKey
- type LabelSet
- func (l *LabelSet) AllowDots() bool
- func (l *LabelSet) AppendString(buf []byte) []byte
- func (l *LabelSet) AsLokiAPI() lokiapi.LabelSet
- func (l *LabelSet) AsMap() map[string]string
- func (l *LabelSet) Delete(s logql.Label)
- func (l *LabelSet) Get(name logql.Label) (v pcommon.Value, ok bool)
- func (l *LabelSet) GetError() (string, bool)
- func (l *LabelSet) GetFloat(name logql.Label) (_ float64, ok bool, err error)
- func (l *LabelSet) GetString(name logql.Label) (string, bool)
- func (l *LabelSet) Len() int
- func (l *LabelSet) Range(cb func(logql.Label, pcommon.Value))
- func (l *LabelSet) Reset()
- func (l *LabelSet) Set(s logql.Label, val pcommon.Value)
- func (l *LabelSet) SetAttrs(attrMaps ...otelstorage.Attrs)
- func (l *LabelSet) SetError(typ string, err error)
- func (l *LabelSet) SetFromRecord(record logstorage.Record)
- func (l *LabelSet) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedLabels ¶
type AggregatedLabels interface { // By returns new set of labels containing only given list of labels. By(...logql.Label) AggregatedLabels // Without returns new set of labels without given list of labels. Without(...logql.Label) AggregatedLabels // Key computes grouping key from set of labels. Key() GroupingKey // Replace replaces labels using given regexp. Replace(dstLabel, replacement, srcLabel string, re *regexp.Regexp) AggregatedLabels // AsLokiAPI returns API structure for label set. AsLokiAPI() lokiapi.LabelSet }
AggregatedLabels is a set of labels.
func AggregatedLabelsFromMap ¶
func AggregatedLabelsFromMap(m map[string]string) AggregatedLabels
AggregatedLabelsFromMap creates new AggregatedLabels from label map.
func AggregatedLabelsFromSet ¶
func AggregatedLabelsFromSet(set LabelSet, by, without map[string]struct{}) AggregatedLabels
AggregatedLabelsFromSet creates new AggregatedLabels from LabelSet.
func EmptyAggregatedLabels ¶
func EmptyAggregatedLabels() AggregatedLabels
EmptyAggregatedLabels returns empty set of aggregated labels.
type LabelSet ¶
type LabelSet struct {
// contains filtered or unexported fields
}
LabelSet is a log record's label set.
func (*LabelSet) AppendString ¶ added in v0.13.0
AppendString appends text representation of labels.
func (*LabelSet) SetAttrs ¶
func (l *LabelSet) SetAttrs(attrMaps ...otelstorage.Attrs)
SetAttrs sets labels from attrs.
func (*LabelSet) SetFromRecord ¶
func (l *LabelSet) SetFromRecord(record logstorage.Record)
SetFromRecord sets labels from given log record.
Click to show internal directories.
Click to hide internal directories.