prometheus

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

func (*FlowMetric) Value

func (fw *FlowMetric) Value() float64

Value returns the value

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 (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.

Directories

Path Synopsis
integration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL