Documentation
¶
Index ¶
- Constants
- type Arguments
- type LabelStore
- type Service
- func (s *Service) CheckAndRemoveStaleMarkers()
- func (s *Service) Collect(m chan<- prometheus.Metric)
- func (s *Service) Data() any
- func (s *Service) Definition() alloy_service.Definition
- func (s *Service) Describe(m chan<- *prometheus.Desc)
- func (s *Service) GetGlobalRefID(componentID string, localRefID uint64) uint64
- func (s *Service) GetLocalRefID(componentID string, globalRefID uint64) uint64
- func (s *Service) GetOrAddGlobalRefID(l labels.Labels) uint64
- func (s *Service) GetOrAddLink(componentID string, localRefID uint64, lbls labels.Labels) uint64
- func (s *Service) Run(ctx context.Context, host alloy_service.Host) error
- func (s *Service) TrackStaleness(ids []StalenessTracker)
- func (s *Service) Update(_ any) error
- type StalenessTracker
Constants ¶
const ServiceName = "labelstore"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 New(l log.Logger, r prometheus.Registerer) *Service
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
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
GetGlobalRefID returns the global refid for a component local combo, or 0 if not found
func (*Service) GetLocalRefID ¶ added in v1.9.0
GetLocalRefID returns the local refid for a component global combo, or 0 if not found
func (*Service) GetOrAddGlobalRefID ¶ added in v1.9.0
GetOrAddGlobalRefID is used to create a global refid for a labelset
func (*Service) GetOrAddLink ¶ added in v1.9.0
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
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
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.