Versions in this module Expand all Collapse all v2 v2.4.3 Mar 21, 2022 Changes in this version + const ErrDataLength + const ErrInvalidChecksum + const ErrMetadataLength + const ErrSliceOutOfRange + const ErrWrongMetadata + const MockStorageModeReadOnly + const MockStorageModeReadWrite + const MockStorageModeWriteOnly + var BenchmarkLabels = labels.Labels + var ErrMethodNotImplemented = errors.New("method is not implemented") + var ErrMetricNameLabelMissing = errors.New("metric name label missing") + var ErrNotSupported = errors.New("not supported") + var ErrParialDeleteChunkNoOverlap = errors.New("interval for partial deletion has not overlap with chunk interval") + var ErrQueryMustContainMetricName = QueryError("query must contain metric name") + var ErrStorageObjectNotFound = errors.New("object not found in storage") + func ChunksToMatrix(ctx context.Context, chunks []Chunk, from, through model.Time) (model.Matrix, error) + func ExpectTables(ctx context.Context, client TableClient, expected []TableDesc) error + func FindSetMatches(pattern string) []string + type ActiveTableProvisionConfig struct + ProvisionedReadThroughput int64 + ProvisionedThroughputOnDemandMode bool + ProvisionedWriteThroughput int64 + ReadScale AutoScalingConfig + WriteScale AutoScalingConfig + func (cfg *ActiveTableProvisionConfig) RegisterFlags(argPrefix string, f *flag.FlagSet) + func (cfg ActiveTableProvisionConfig) BuildTableDesc(tableName string, tags Tags) TableDesc + type AutoScalingConfig struct + Enabled bool + InCooldown int64 + MaxCapacity int64 + MinCapacity int64 + OutCooldown int64 + RoleARN string + TargetValue float64 + func (cfg *AutoScalingConfig) RegisterFlags(argPrefix string, f *flag.FlagSet) + type BaseSchema interface + FilterReadQueries func(queries []IndexQuery, shard *astmapper.ShardAnnotation) []IndexQuery + GetReadQueriesForMetric func(from, through model.Time, userID string, metricName string) ([]IndexQuery, error) + GetReadQueriesForMetricLabel func(from, through model.Time, userID string, metricName string, labelName string) ([]IndexQuery, error) + GetReadQueriesForMetricLabelValue func(from, through model.Time, userID string, metricName string, labelName string, ...) ([]IndexQuery, error) + type Bucket struct + type BucketClient interface + DeleteChunksBefore func(ctx context.Context, ts time.Time) error + type CacheGenNumLoader interface + GetStoreCacheGenNumber func(tenantIDs []string) string + type CardinalityExceededError struct + LabelName string + Limit int32 + MetricName string + Size int32 + func (e CardinalityExceededError) Error() string + type Chunk struct + ChecksumSet bool + Data prom_chunk.Chunk + Encoding prom_chunk.Encoding + Metric labels.Labels + func NewChunk(userID string, fp model.Fingerprint, metric labels.Labels, c prom_chunk.Chunk, ...) Chunk + func ParseExternalKey(userID, externalKey string) (Chunk, error) + func (c *Chunk) Decode(decodeContext *DecodeContext, input []byte) error + func (c *Chunk) Encode() error + func (c *Chunk) EncodeTo(buf *bytes.Buffer) error + func (c *Chunk) Encoded() ([]byte, error) + func (c *Chunk) Samples(from, through model.Time) ([]model.SamplePair, error) + func (c *Chunk) Slice(from, through model.Time) (*Chunk, error) + type Client interface + DeleteChunk func(ctx context.Context, userID, chunkID string) error + GetChunks func(ctx context.Context, chunks []Chunk) ([]Chunk, error) + IsChunkNotFoundErr func(err error) bool + PutChunks func(ctx context.Context, chunks []Chunk) error + Stop func() + type CompositeStore struct + func NewCompositeStore(cacheGenNumLoader CacheGenNumLoader) CompositeStore + func (c *CompositeStore) AddPeriod(storeCfg StoreConfig, cfg PeriodConfig, index IndexClient, chunks Client, ...) error + func (c CompositeStore) GetChunkFetcher(tm model.Time) *Fetcher + func (c CompositeStore) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, ...) ([][]Chunk, []*Fetcher, error) + func (c CompositeStore) LabelNamesForMetricName(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error) + func (c CompositeStore) LabelValuesForMetricName(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error) + func (c CompositeStore) Put(ctx context.Context, chunks []Chunk) error + func (c CompositeStore) PutOne(ctx context.Context, from, through model.Time, chunk Chunk) error + func (c CompositeStore) Stop() + type DayTime struct + func (d *DayTime) String() string + func (d *DayTime) UnmarshalYAML(unmarshal func(interface{}) error) error + func (d DayTime) MarshalYAML() (interface{}, error) + type DecodeContext struct + func NewDecodeContext() *DecodeContext + type ExtraTables struct + TableClient TableClient + Tables []TableDesc + type Fetcher struct + func NewChunkFetcher(cacher cache.Cache, cacheStubs bool, schema SchemaConfig, storage Client, ...) (*Fetcher, error) + func (c *Fetcher) FetchChunks(ctx context.Context, chunks []Chunk, keys []string) ([]Chunk, error) + func (c *Fetcher) IsChunkNotFoundErr(err error) bool + func (c *Fetcher) Stop() + type InactiveTableProvisionConfig struct + InactiveReadScale AutoScalingConfig + InactiveReadScaleLastN int64 + InactiveReadThroughput int64 + InactiveThroughputOnDemandMode bool + InactiveWriteScale AutoScalingConfig + InactiveWriteScaleLastN int64 + InactiveWriteThroughput int64 + func (cfg *InactiveTableProvisionConfig) RegisterFlags(argPrefix string, f *flag.FlagSet) + func (cfg InactiveTableProvisionConfig) BuildTableDesc(tableName string, tags Tags, disableAutoscale bool) TableDesc + type IndexClient interface + BatchWrite func(context.Context, WriteBatch) error + NewWriteBatch func() WriteBatch + QueryPages func(ctx context.Context, queries []IndexQuery, callback QueryPagesCallback) error + Stop func() + type IndexEntry struct + HashValue string + RangeValue []byte + TableName string + Value []byte + type IndexEntryProcessor interface + AcceptUser func(user string) bool + Flush func() error + ProcessIndexEntry func(indexEntry IndexEntry) error + type IndexQuery struct + HashValue string + Immutable bool + RangeValuePrefix []byte + RangeValueStart []byte + TableName string + ValueEqual []byte + type IndexReader interface + IndexTableNames func(ctx context.Context) ([]string, error) + ReadIndexEntries func(ctx context.Context, table string, processors []IndexEntryProcessor) error + type MockStorage struct + func NewMockStorage() *MockStorage + func (*MockStorage) Stop() + func (m *MockStorage) BatchWrite(ctx context.Context, batch WriteBatch) error + func (m *MockStorage) CreateTable(_ context.Context, desc TableDesc) error + func (m *MockStorage) DeleteChunk(ctx context.Context, userID, chunkID string) error + func (m *MockStorage) DeleteObject(ctx context.Context, objectKey string) error + func (m *MockStorage) DeleteTable(_ context.Context, name string) error + func (m *MockStorage) DescribeTable(_ context.Context, name string) (desc TableDesc, isActive bool, err error) + func (m *MockStorage) GetChunks(ctx context.Context, chunkSet []Chunk) ([]Chunk, error) + func (m *MockStorage) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error) + func (m *MockStorage) GetObjectCount() int + func (m *MockStorage) GetSortedObjectKeys() []string + func (m *MockStorage) IsChunkNotFoundErr(err error) bool + func (m *MockStorage) IsObjectNotFoundErr(err error) bool + func (m *MockStorage) List(ctx context.Context, prefix, delimiter string) ([]StorageObject, []StorageCommonPrefix, error) + func (m *MockStorage) ListTables(_ context.Context) ([]string, error) + func (m *MockStorage) NewWriteBatch() WriteBatch + func (m *MockStorage) PutChunks(_ context.Context, chunks []Chunk) error + func (m *MockStorage) PutObject(ctx context.Context, objectKey string, object io.ReadSeeker) error + func (m *MockStorage) QueryPages(ctx context.Context, queries []IndexQuery, callback QueryPagesCallback) error + func (m *MockStorage) SetMode(mode MockStorageMode) + func (m *MockStorage) UpdateTable(_ context.Context, _, desc TableDesc) error + type MockStorageMode int + type ObjectAndIndexClient interface + PutChunksAndIndex func(ctx context.Context, chunks []Chunk, index WriteBatch) error + type ObjectClient interface + DeleteObject func(ctx context.Context, objectKey string) error + GetObject func(ctx context.Context, objectKey string) (io.ReadCloser, int64, error) + IsObjectNotFoundErr func(err error) bool + List func(ctx context.Context, prefix string, delimiter string) ([]StorageObject, []StorageCommonPrefix, error) + PutObject func(ctx context.Context, objectKey string, object io.ReadSeeker) error + Stop func() + type PeriodConfig struct + ChunkTables PeriodicTableConfig + From DayTime + IndexTables PeriodicTableConfig + IndexType string + ObjectType string + RowShards uint32 + Schema string + func (cfg *PeriodConfig) UnmarshalYAML(unmarshal func(interface{}) error) error + func (cfg *PeriodConfig) VersionAsInt() (int, error) + func (cfg PeriodConfig) CreateSchema() (BaseSchema, error) + type PeriodicTableConfig struct + Period time.Duration + Prefix string + Tags Tags + func (cfg *PeriodicTableConfig) TableFor(t model.Time) string + func (cfg *PeriodicTableConfig) UnmarshalYAML(unmarshal func(interface{}) error) error + func (cfg PeriodicTableConfig) MarshalYAML() (interface{}, error) + type ProvisionConfig struct + func (cfg *ProvisionConfig) RegisterFlags(argPrefix string, f *flag.FlagSet) + type QueryError string + func (e QueryError) Error() string + type QueryPagesCallback func(IndexQuery, ReadBatch) bool + type ReadBatch interface + Iterator func() ReadBatchIterator + type ReadBatchIterator interface + Next func() bool + RangeValue func() []byte + Value func() []byte + type SchemaConfig struct + Configs []PeriodConfig + func DefaultSchemaConfig(store, schema string, from model.Time) SchemaConfig + func (cfg *SchemaConfig) ForEachAfter(t model.Time, f func(config *PeriodConfig)) + func (cfg *SchemaConfig) Load() error + func (cfg *SchemaConfig) RegisterFlags(f *flag.FlagSet) + func (cfg *SchemaConfig) Validate() error + func (cfg SchemaConfig) ChunkTableFor(t model.Time) (string, error) + func (cfg SchemaConfig) ExternalKey(chunk Chunk) string + func (cfg SchemaConfig) SchemaForTime(t model.Time) (PeriodConfig, error) + func (cfg SchemaConfig) VersionForChunk(c Chunk) int + type SeriesStoreSchema interface + GetCacheKeysAndLabelWriteEntries func(from, through model.Time, userID string, metricName string, ...) ([]string, [][]IndexEntry, error) + GetChunkWriteEntries func(from, through model.Time, userID string, metricName string, ...) ([]IndexEntry, error) + GetChunksForSeries func(from, through model.Time, userID string, seriesID []byte) ([]IndexQuery, error) + GetLabelNamesForSeries func(from, through model.Time, userID string, seriesID []byte) ([]IndexQuery, error) + GetSeriesDeleteEntries func(from, through model.Time, userID string, metric labels.Labels, ...) ([]IndexEntry, error) + type StorageCommonPrefix string + type StorageObject struct + Key string + ModifiedAt time.Time + type Store interface + GetChunkFetcher func(tm model.Time) *Fetcher + GetChunkRefs func(ctx context.Context, userID string, from, through model.Time, ...) ([][]Chunk, []*Fetcher, error) + LabelNamesForMetricName func(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error) + LabelValuesForMetricName func(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error) + Put func(ctx context.Context, chunks []Chunk) error + PutOne func(ctx context.Context, from, through model.Time, chunk Chunk) error + Stop func() + type StoreConfig struct + CacheLookupsOlderThan model.Duration + ChunkCacheConfig cache.Config + DisableIndexDeduplication bool + WriteDedupeCacheConfig cache.Config + func (cfg *StoreConfig) RegisterFlags(f *flag.FlagSet) + func (cfg *StoreConfig) Validate(logger log.Logger) error + type StoreLimits interface + MaxChunksPerQueryFromStore func(userID string) int + MaxQueryLength func(userID string) time.Duration + type TableClient interface + CreateTable func(ctx context.Context, desc TableDesc) error + DeleteTable func(ctx context.Context, name string) error + DescribeTable func(ctx context.Context, name string) (desc TableDesc, isActive bool, err error) + ListTables func(ctx context.Context) ([]string, error) + Stop func() + UpdateTable func(ctx context.Context, current, expected TableDesc) error + type TableDesc struct + Name string + ProvisionedRead int64 + ProvisionedWrite int64 + ReadScale AutoScalingConfig + Tags Tags + UseOnDemandIOMode bool + WriteScale AutoScalingConfig + func (desc TableDesc) Equals(other TableDesc) bool + type TableManager struct + func NewTableManager(cfg TableManagerConfig, schemaCfg SchemaConfig, maxChunkAge time.Duration, ...) (*TableManager, error) + func (m *TableManager) SyncTables(ctx context.Context) error + type TableManagerConfig struct + ChunkTables ProvisionConfig + CreationGracePeriod time.Duration + IndexTables ProvisionConfig + PollInterval time.Duration + RetentionDeletesEnabled bool + RetentionPeriod time.Duration + RetentionPeriodModel model.Duration + ThroughputUpdatesDisabled bool + func (cfg *TableManagerConfig) MarshalYAML() (interface{}, error) + func (cfg *TableManagerConfig) RegisterFlags(f *flag.FlagSet) + func (cfg *TableManagerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error + func (cfg *TableManagerConfig) Validate() error + type Tags map[string]string + func (ts *Tags) Set(s string) error + func (ts *Tags) UnmarshalYAML(unmarshal func(interface{}) error) error + func (ts Tags) Equals(other Tags) bool + func (ts Tags) String() string + type UniqueStrings struct + func NewUniqueStrings(sizeHint int) UniqueStrings + func (us *UniqueStrings) Add(strings ...string) + func (us UniqueStrings) Strings() []string + type WriteBatch interface + Add func(tableName, hashValue string, rangeValue []byte, value []byte) + Delete func(tableName, hashValue string, rangeValue []byte) Other modules containing this package github.com/pao214/loki/v3