limits

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTooManyMetricLabels = errors.New("too many metric labels")
	ErrTooManyLogLabels    = errors.New("too many log labels")
)

Functions

This section is empty.

Types

type TenantLimits

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

TenantLimits provides functionalities to query and validate metrics and log labels limits for a particular tenant.

func NewTenantLimits

func NewTenantLimits(tp TenantProvider) *TenantLimits

func (*TenantLimits) LogLabels

func (tl *TenantLimits) LogLabels(ctx context.Context, tenantID model.GlobalID) (int, error)

LogLabels returns the log labels limit for the specified tenant.

func (*TenantLimits) MetricLabels

func (tl *TenantLimits) MetricLabels(ctx context.Context, tenantID model.GlobalID) (int, error)

MetricLabels returns the metric labels limit for the specified tenant.

func (*TenantLimits) ValidateLogLabels

func (tl *TenantLimits) ValidateLogLabels(ctx context.Context, tenantID model.GlobalID, n int) error

ValidateLogLabels validates the given number of log labels against the specific tenant limits.

func (*TenantLimits) ValidateMetricLabels

func (tl *TenantLimits) ValidateMetricLabels(ctx context.Context, tenantID model.GlobalID, n int) error

ValidateMetricLabels validates the given number of metric labels against the specific tenant limits.

type TenantProvider

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

Jump to

Keyboard shortcuts

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