prometheus

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fanout

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

Fanout supports the default Alloy style of appendables since it can go to multiple outputs. It also allows the intercepting of appends. It also maintains the responsibility of assigning global ref IDs to a series via the label store.

func NewFanout

func NewFanout(children []storage.Appendable, componentID string, register prometheus.Registerer, ls labelstore.LabelStore) *Fanout

NewFanout creates a fanout appendable.

func (*Fanout) Appender

func (f *Fanout) Appender(ctx context.Context) storage.Appender

Appender satisfies the Appendable interface.

func (*Fanout) Clear added in v1.14.0

func (f *Fanout) Clear()

func (*Fanout) UpdateChildren

func (f *Fanout) UpdateChildren(children []storage.Appendable)

UpdateChildren allows changing of the children of the fanout.

When children change, the store is cleared to start a new ref generation. This guards against two ref collision hazards that arise when the appender type changes between passthrough (1 child) and seriesRefMapping (N children):

passthrough → seriesRefMapping: a cached raw child ref (e.g. WAL ref) may collide numerically with a store-issued unique ref for a different series. The store guards against this with a label hash check on every mapping lookup.

seriesRefMapping → passthrough: a cached store-issued unique ref is meaningless to the child and must not be forwarded. Clear returns the new generation boundary; the passthrough zeros any ref below it before forwarding.

type Interceptor

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

Interceptor is a storage.Appendable which invokes callback functions upon getting data. Interceptor should not be modified once created. All callback fields are optional.

func NewInterceptor

func NewInterceptor(next storage.Appendable, opts ...InterceptorOption) *Interceptor

NewInterceptor creates a new Interceptor storage.Appendable. Options can be provided to NewInterceptor to install custom hooks for different methods.

func (*Interceptor) Appender

func (i *Interceptor) Appender(ctx context.Context) storage.Appender

Appender satisfies the Appendable interface.

func (*Interceptor) String added in v1.12.0

func (i *Interceptor) String() string

type InterceptorOption

type InterceptorOption func(*Interceptor)

InterceptorOption is an option argument passed to NewInterceptor.

func WithAppendHook

func WithAppendHook(f func(ref storage.SeriesRef, l labels.Labels, t int64, v float64, next storage.Appender) (storage.SeriesRef, error)) InterceptorOption

WithAppendHook returns an InterceptorOption which hooks into calls to Append.

func WithComponentID added in v1.12.0

func WithComponentID(id string) InterceptorOption

WithComponentID returns an InterceptorOptions which is used to set the componentID of the Interceptor. This is useful for debugging

func WithExemplarHook

WithExemplarHook returns an InterceptorOption which hooks into calls to AppendExemplar.

func WithHistogramHook

WithHistogramHook returns an InterceptorOption which hooks into calls to AppendHistogram.

func WithMetadataHook

WithMetadataHook returns an InterceptorOption which hooks into calls to UpdateMetadata.

func WithSTZeroSampleHook added in v1.14.0

func WithSTZeroSampleHook(f func(ref storage.SeriesRef, l labels.Labels, t, st int64, next storage.Appender) (storage.SeriesRef, error)) InterceptorOption

WithSTZeroSampleHook returns an InterceptorOption which hooks into calls to AppendSTZeroSample.

type NoopMetadataStore

type NoopMetadataStore map[string]scrape.MetricMetadata

NoopMetadataStore implements the MetricMetadataStore interface.

func (NoopMetadataStore) GetMetadata

func (ms NoopMetadataStore) GetMetadata(_ string) (scrape.MetricMetadata, bool)

func (NoopMetadataStore) LengthMetadata

func (ms NoopMetadataStore) LengthMetadata() int

func (NoopMetadataStore) ListMetadata

func (ms NoopMetadataStore) ListMetadata() []scrape.MetricMetadata

func (NoopMetadataStore) SizeMetadata

func (ms NoopMetadataStore) SizeMetadata() int

func (NoopMetadataStore) UpdateMetadata added in v1.11.0

func (ms NoopMetadataStore) UpdateMetadata(familyName string, md metadata.Metadata)

Jump to

Keyboard shortcuts

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