memory

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 23 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags added in v1.18.1

func AddFlags(flagSet *flag.FlagSet)

AddFlags from this storage to the CLI

Types

type Configuration added in v1.59.0

type Configuration struct {
	// MaxTraces is the maximum amount of traces to store in memory.
	// If multi-tenancy is enabled, this limit applies per tenant.
	// Zero value (default) means no limit (Warning: memory usage will be unbounded).
	MaxTraces int `mapstructure:"max_traces"`
}

Configuration describes the options to customize the storage behavior.

func (*Configuration) Validate added in v1.61.0

func (c *Configuration) Validate() error

type Factory

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

Factory implements storage.Factory and creates storage components backed by memory store.

func NewFactory

func NewFactory() *Factory

NewFactory creates a new Factory.

func NewFactoryWithConfig added in v1.50.0

func NewFactoryWithConfig(
	cfg Configuration,
	metricsFactory metrics.Factory,
	logger *zap.Logger,
) *Factory

NewFactoryWithConfig is used from jaeger(v2).

func (*Factory) AddFlags added in v1.5.0

func (*Factory) AddFlags(flagSet *flag.FlagSet)

AddFlags implements plugin.Configurable

func (*Factory) CreateArchiveSpanReader added in v1.51.0

func (f *Factory) CreateArchiveSpanReader() (spanstore.Reader, error)

CreateArchiveSpanReader implements storage.ArchiveFactory

func (*Factory) CreateArchiveSpanWriter added in v1.51.0

func (f *Factory) CreateArchiveSpanWriter() (spanstore.Writer, error)

CreateArchiveSpanWriter implements storage.ArchiveFactory

func (*Factory) CreateDependencyReader

func (f *Factory) CreateDependencyReader() (dependencystore.Reader, error)

CreateDependencyReader implements storage.Factory

func (*Factory) CreateLock added in v1.28.0

func (*Factory) CreateLock() (distributedlock.Lock, error)

CreateLock implements storage.SamplingStoreFactory

func (*Factory) CreateSamplingStore added in v1.28.0

func (*Factory) CreateSamplingStore(maxBuckets int) (samplingstore.Store, error)

CreateSamplingStore implements storage.SamplingStoreFactory

func (*Factory) CreateSpanReader

func (f *Factory) CreateSpanReader() (spanstore.Reader, error)

CreateSpanReader implements storage.Factory

func (*Factory) CreateSpanWriter

func (f *Factory) CreateSpanWriter() (spanstore.Writer, error)

CreateSpanWriter implements storage.Factory

func (*Factory) InitFromViper added in v1.5.0

func (f *Factory) InitFromViper(v *viper.Viper, _ *zap.Logger)

InitFromViper implements plugin.Configurable

func (*Factory) Initialize

func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) error

Initialize implements storage.Factory

func (*Factory) Purge added in v1.60.0

func (f *Factory) Purge(ctx context.Context) error

Purge removes all data from the Factory's underlying Memory store. This function is intended for testing purposes only and should not be used in production environments.

type Options added in v1.5.0

type Options struct {
	Configuration Configuration `mapstructure:",squash"`
}

Options stores the configuration entries for this storage

func (*Options) InitFromViper added in v1.5.0

func (opt *Options) InitFromViper(v *viper.Viper)

InitFromViper initializes the options struct with values from Viper

type SamplingStore added in v1.28.0

type SamplingStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SamplingStore is an in-memory store for sampling data

func NewSamplingStore added in v1.28.0

func NewSamplingStore(maxBuckets int) *SamplingStore

NewSamplingStore creates an in-memory sampling store.

func (*SamplingStore) GetLatestProbabilities added in v1.28.0

func (ss *SamplingStore) GetLatestProbabilities() (model.ServiceOperationProbabilities, error)

GetLatestProbabilities implements samplingstore.Store#GetLatestProbabilities.

func (*SamplingStore) GetThroughput added in v1.28.0

func (ss *SamplingStore) GetThroughput(start, end time.Time) ([]*model.Throughput, error)

GetThroughput implements samplingstore.Store#GetThroughput.

func (*SamplingStore) InsertProbabilitiesAndQPS added in v1.28.0

func (ss *SamplingStore) InsertProbabilitiesAndQPS(
	hostname string,
	probabilities model.ServiceOperationProbabilities,
	qps model.ServiceOperationQPS,
) error

InsertProbabilitiesAndQPS implements samplingstore.Store#InsertProbabilitiesAndQPS.

func (*SamplingStore) InsertThroughput added in v1.28.0

func (ss *SamplingStore) InsertThroughput(throughput []*model.Throughput) error

InsertThroughput implements samplingstore.Store#InsertThroughput.

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Store is an in-memory store of traces

func NewStore

func NewStore() *Store

NewStore creates an unbounded in-memory store

func WithConfiguration added in v1.5.0

func WithConfiguration(cfg Configuration) *Store

WithConfiguration creates a new in memory storage based on the given configuration

func (*Store) FindTraceIDs added in v1.9.0

FindTraceIDs is not implemented.

func (*Store) FindTraces

func (st *Store) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error)

FindTraces returns all traces in the query parameters are satisfied by a trace's span

func (*Store) GetDependencies

func (st *Store) GetDependencies(ctx context.Context, endTs time.Time, lookback time.Duration) ([]model.DependencyLink, error)

GetDependencies returns dependencies between services

func (*Store) GetOperations

func (st *Store) GetOperations(
	ctx context.Context,
	query spanstore.OperationQueryParameters,
) ([]spanstore.Operation, error)

GetOperations returns the operations of a given service

func (*Store) GetServices

func (st *Store) GetServices(ctx context.Context) ([]string, error)

GetServices returns a list of all known services

func (*Store) GetTrace

func (st *Store) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error)

GetTrace gets a trace

func (*Store) WriteSpan

func (st *Store) WriteSpan(ctx context.Context, span *model.Span) error

WriteSpan writes the given span

type Tenant added in v1.37.0

type Tenant struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Tenant is an in-memory store of traces for a single tenant

Jump to

Keyboard shortcuts

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