pusher

package
v0.0.0-...-05b72f9 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelValueMetrics        = "metrics"
	LabelValueLogs           = "logs"
	LabelValueClient         = "client"
	LabelValueRetryExhausted = "retry_exhausted"
	LabelValueTenant         = "tenant"
)

Variables

This section is empty.

Functions

func ClientFromRemoteInfo

func ClientFromRemoteInfo(remote *sm.RemoteInfo) (*prom.ClientConfig, error)

func NewRegistry

func NewRegistry[T any]() *registry[T]

Types

type AlreadyRegisteredError

type AlreadyRegisteredError string

func (AlreadyRegisteredError) Error

func (e AlreadyRegisteredError) Error() string

type Factory

type Factory func(ctx context.Context, tm TenantProvider, logger zerolog.Logger, promRegisterer prometheus.Registerer) Publisher

type Metrics

type Metrics struct {
	PushCounter    *prometheus.CounterVec
	ErrorCounter   *prometheus.CounterVec
	BytesOut       *prometheus.CounterVec
	FailedCounter  *prometheus.CounterVec
	RetriesCounter *prometheus.CounterVec

	// For experimental publisher only
	DroppedCounter  *prometheus.CounterVec
	ResponseCounter *prometheus.CounterVec

	InstalledHandlers prometheus.Gauge
}

Metrics contains the prometheus Metrics for a publisher.

func NewMetrics

func NewMetrics(promRegisterer prometheus.Registerer) (m Metrics)

NewMetrics returns a new set of publisher metrics registered in the given registerer.

func (Metrics) WithTenant

func (m Metrics) WithTenant(localID int64, regionID int) Metrics

WithTenant returns a new set of Metrics with the local and region ID labels already included.

func (Metrics) WithType

func (m Metrics) WithType(t string) Metrics

WithType returns a new set of Metrics with the given type label.

type NotFoundError

type NotFoundError struct {
	Requested string
	Accepted  []string
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Payload

type Payload interface {
	Tenant() model.GlobalID
	Metrics() []prompb.TimeSeries
	Streams() []logproto.Stream
}

type Publisher

type Publisher interface {
	Publish(Payload)
}

type TenantProvider

type TenantProvider interface {
	GetTenant(context.Context, *sm.TenantInfo) (*sm.Tenant, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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