labelstore

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "labelstore"

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments struct{}

type LabelStore

type LabelStore interface {
	// GetOrAddLink returns the global id for the values, if none found one will be created based on the lbls.
	GetOrAddLink(componentID string, localRefID uint64, lbls labels.Labels) uint64

	// GetOrAddGlobalRefID finds or adds a global id for the given label map.
	GetOrAddGlobalRefID(l labels.Labels) uint64

	// GetGlobalRefID returns the global id for a component and the local id. Returns 0 if nothing found.
	GetGlobalRefID(componentID string, localRefID uint64) uint64

	// GetLocalRefID gets the mapping from global to local id specific to a component. Returns 0 if nothing found.
	GetLocalRefID(componentID string, globalRefID uint64) uint64

	// TrackStaleness adds a stale marker if NaN, then that reference will be removed on the next check. If not a NaN
	// then if tracked will remove it.
	TrackStaleness(ids []StalenessTracker)

	// CheckAndRemoveStaleMarkers identifies any series with a stale marker and removes those entries from the LabelStore.
	CheckAndRemoveStaleMarkers()
}

type Service added in v1.9.0

type Service struct {
	// contains filtered or unexported fields
}

func New

func (*Service) CheckAndRemoveStaleMarkers added in v1.9.0

func (s *Service) CheckAndRemoveStaleMarkers()

CheckAndRemoveStaleMarkers is called to garbage collect and items that have grown stale over stale duration (10m)

func (*Service) Collect added in v1.9.0

func (s *Service) Collect(m chan<- prometheus.Metric)

func (*Service) Data added in v1.9.0

func (s *Service) Data() any

Data returns the Data associated with a Service. Data must always return the same value across multiple calls, as callers are expected to be able to cache the result.

Data may be invoked before Run.

func (*Service) Definition added in v1.9.0

func (s *Service) Definition() alloy_service.Definition

Definition returns the Definition of the Service. Definition must always return the same value across all calls.

func (*Service) Describe added in v1.9.0

func (s *Service) Describe(m chan<- *prometheus.Desc)

func (*Service) GetGlobalRefID added in v1.9.0

func (s *Service) GetGlobalRefID(componentID string, localRefID uint64) uint64

GetGlobalRefID returns the global refid for a component local combo, or 0 if not found

func (*Service) GetLocalRefID added in v1.9.0

func (s *Service) GetLocalRefID(componentID string, globalRefID uint64) uint64

GetLocalRefID returns the local refid for a component global combo, or 0 if not found

func (*Service) GetOrAddGlobalRefID added in v1.9.0

func (s *Service) GetOrAddGlobalRefID(l labels.Labels) uint64

GetOrAddGlobalRefID is used to create a global refid for a labelset

func (s *Service) GetOrAddLink(componentID string, localRefID uint64, lbls labels.Labels) uint64

GetOrAddLink is called by a remote_write endpoint component to add mapping and get back the global id.

func (*Service) Run added in v1.9.0

func (s *Service) Run(ctx context.Context, host alloy_service.Host) error

Run starts a Service. Run must block until the provided context is canceled. Returning an error should be treated as a fatal error for the Service.

func (*Service) TrackStaleness added in v1.9.0

func (s *Service) TrackStaleness(ids []StalenessTracker)

func (*Service) Update added in v1.9.0

func (s *Service) Update(_ any) error

Update updates a Service at runtime. Update is never called if [Definition.ConfigType] is nil. newConfig will be the same type as ConfigType; if ConfigType is a pointer to a type, newConfig will be a pointer to the same type.

Update will be called once before Run, and may be called while Run is active.

type StalenessTracker

type StalenessTracker struct {
	GlobalRefID uint64
	Value       float64
	Labels      labels.Labels
}

Jump to

Keyboard shortcuts

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