pusher

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Payload

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

type Publisher

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

func NewPublisher

func NewPublisher(tm *TenantManager, publishCh <-chan Payload, logger zerolog.Logger, promRegisterer prometheus.Registerer) *Publisher

func (*Publisher) Run

func (p *Publisher) Run(ctx context.Context) error

type TenantManager added in v0.0.18

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

func NewTenantManager added in v0.0.18

func NewTenantManager(ctx context.Context, tenantsClient sm.TenantsClient, tenantCh <-chan sm.Tenant, timeout time.Duration) *TenantManager

NewTenantManager creates a new tenant manager that is able to retrieve tenants from the remote API using the specified tenantsClient or receive them over the provided tenantCh channel. It will keep them for a duration no longer than `timeout`.

A new goroutine is started which stops when the provided context is cancelled.

func (*TenantManager) GetTenant added in v0.0.18

func (tm *TenantManager) GetTenant(ctx context.Context, req *sm.TenantInfo) (*sm.Tenant, error)

GetTenant retrieves the tenant specified by `req`, either from a local cache or by making a request to the API.

Jump to

Keyboard shortcuts

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