Documentation ¶
Index ¶
- Variables
- type FlowMetric
- type GlobalRefMap
- func (g *GlobalRefMap) AddStaleMarker(globalRefID uint64, l labels.Labels)
- func (g *GlobalRefMap) CheckStaleMarkers()
- func (g *GlobalRefMap) GetGlobalRefID(componentID string, localRefID uint64) uint64
- func (g *GlobalRefMap) GetLocalRefID(componentID string, globalRefID uint64) uint64
- func (g *GlobalRefMap) GetOrAddGlobalRefID(l labels.Labels) uint64
- func (g *GlobalRefMap) GetOrAddLink(componentID string, localRefID uint64, fm *FlowMetric) uint64
- func (g *GlobalRefMap) RemoveStaleMarker(globalRefID uint64)
- type Receiver
Constants ¶
This section is empty.
Variables ¶
var GlobalRefMapping = &GlobalRefMap{}
GlobalRefMapping is used when translating to and from remote writes and the rest of the system (mostly scrapers) normal components except those should in general NOT need this.
Functions ¶
This section is empty.
Types ¶
type FlowMetric ¶
type FlowMetric struct {
// contains filtered or unexported fields
}
FlowMetric is a wrapper around a single metric without the timestamp.
func NewFlowMetric ¶
func NewFlowMetric(globalRefID uint64, lbls labels.Labels, value float64) *FlowMetric
NewFlowMetric instantiates a new flow metric
func (*FlowMetric) GlobalRefID ¶
func (fw *FlowMetric) GlobalRefID() uint64
GlobalRefID Retrieves the GlobalRefID
func (*FlowMetric) LabelsCopy ¶
func (fw *FlowMetric) LabelsCopy() labels.Labels
LabelsCopy returns a copy of the labels structure
func (*FlowMetric) RawLabels ¶
func (fw *FlowMetric) RawLabels() labels.Labels
RawLabels returns the actual underlying labels that SHOULD be treated as immutable. Usage of this must be very careful to ensure that nothing that consume this mutates labels in anyway.
func (*FlowMetric) Relabel ¶
func (fw *FlowMetric) Relabel(cfgs ...*relabel.Config) *FlowMetric
Relabel applies normal prometheus relabel rules and returns a flow metric. NOTE this may return itself.
type GlobalRefMap ¶
type GlobalRefMap struct {
// contains filtered or unexported fields
}
GlobalRefMap allows conversion from remote_write refids to global refs ids that everything else can use
func (*GlobalRefMap) AddStaleMarker ¶
func (g *GlobalRefMap) AddStaleMarker(globalRefID uint64, l labels.Labels)
AddStaleMarker adds a stale marker
func (*GlobalRefMap) CheckStaleMarkers ¶
func (g *GlobalRefMap) CheckStaleMarkers()
CheckStaleMarkers is called to garbage collect and items that have grown stale over stale duration (10m)
func (*GlobalRefMap) GetGlobalRefID ¶
func (g *GlobalRefMap) GetGlobalRefID(componentID string, localRefID uint64) uint64
GetGlobalRefID returns the global refid for a component local combo, or 0 if not found
func (*GlobalRefMap) GetLocalRefID ¶
func (g *GlobalRefMap) GetLocalRefID(componentID string, globalRefID uint64) uint64
GetLocalRefID returns the local refid for a component global combo, or 0 if not found
func (*GlobalRefMap) GetOrAddGlobalRefID ¶
func (g *GlobalRefMap) GetOrAddGlobalRefID(l labels.Labels) uint64
GetOrAddGlobalRefID is used to create a global refid for a labelset
func (*GlobalRefMap) GetOrAddLink ¶
func (g *GlobalRefMap) GetOrAddLink(componentID string, localRefID uint64, fm *FlowMetric) uint64
GetOrAddLink is called by a remote_write endpoint component to add mapping and get back the global id.
func (*GlobalRefMap) RemoveStaleMarker ¶
func (g *GlobalRefMap) RemoveStaleMarker(globalRefID uint64)
RemoveStaleMarker removes a stale marker
type Receiver ¶
type Receiver struct { // metrics should be considered immutable Receive func(timestamp int64, metrics []*FlowMetric) }
Receiver is used to pass an array of metrics to another receiver
func (Receiver) RiverCapsule ¶
func (r Receiver) RiverCapsule()
RiverCapsule marks receivers as a capsule.