series

package
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DedupedChunksTotal = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: "loki",
		Name:      "chunk_store_deduped_chunks_total",
		Help:      "Count of chunks which were not stored because they have already been stored by another replica.",
	})

	IndexEntriesPerChunk = promauto.NewHistogram(prometheus.HistogramOpts{
		Namespace: "loki",
		Name:      "chunk_store_index_entries_per_chunk",
		Help:      "Number of entries written to storage per chunk.",
		Buckets:   prometheus.ExponentialBuckets(1, 2, 5),
	})
)

Functions

func FindSetMatches

func FindSetMatches(pattern string) []string

FindSetMatches returns list of values that can be equality matched on. copied from Prometheus querier.go, removed check for Prometheus wrapper.

Types

type IndexGatewayClientStore

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

func (*IndexGatewayClientStore) GetChunkRefs

func (c *IndexGatewayClientStore) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, allMatchers ...*labels.Matcher) ([]logproto.ChunkRef, error)

func (*IndexGatewayClientStore) GetSeries

func (c *IndexGatewayClientStore) GetSeries(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) ([]labels.Labels, error)

func (*IndexGatewayClientStore) LabelNamesForMetricName

func (c *IndexGatewayClientStore) LabelNamesForMetricName(ctx context.Context, userID string, from, through model.Time, metricName string) ([]string, error)

LabelNamesForMetricName retrieves all label names for a metric name.

func (*IndexGatewayClientStore) LabelValuesForMetricName

func (c *IndexGatewayClientStore) LabelValuesForMetricName(ctx context.Context, userID string, from, through model.Time, metricName string, labelName string, matchers ...*labels.Matcher) ([]string, error)

func (*IndexGatewayClientStore) SetChunkFilterer

func (c *IndexGatewayClientStore) SetChunkFilterer(chunkFilter chunk.RequestChunkFilterer)

func (*IndexGatewayClientStore) Stats

func (c *IndexGatewayClientStore) Stats(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) (*stats.Stats, error)

type IndexStore

type IndexStore interface {
	GetChunkRefs(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) ([]logproto.ChunkRef, error)
	GetSeries(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) ([]labels.Labels, error)
	LabelValuesForMetricName(ctx context.Context, userID string, from, through model.Time, metricName string, labelName string, matchers ...*labels.Matcher) ([]string, error)
	LabelNamesForMetricName(ctx context.Context, userID string, from, through model.Time, metricName string) ([]string, error)
	Stats(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) (*stats.Stats, error)
	// SetChunkFilterer sets a chunk filter to be used when retrieving chunks.
	// This is only used for GetSeries implementation.
	// Todo we might want to pass it as a parameter to GetSeries instead.
	SetChunkFilterer(chunkFilter chunk.RequestChunkFilterer)
}

func NewIndexGatewayClientStore

func NewIndexGatewayClientStore(client IndexGatewayClient, fallbackStore IndexStore) IndexStore

func NewIndexStore

func NewIndexStore(schemaCfg config.SchemaConfig, schema index.SeriesStoreSchema, index index.Client, fetcher chunkFetcher, chunkBatchSize int) IndexStore

type IndexWriter

type IndexWriter interface {
	NewWriteBatch() index.WriteBatch
	BatchWrite(context.Context, index.WriteBatch) error
}

type SchemaWrites

type SchemaWrites interface {
	GetChunkWriteEntries(from, through model.Time, userID string, metricName string, labels labels.Labels, chunkID string) ([]index.Entry, error)
	GetCacheKeysAndLabelWriteEntries(from, through model.Time, userID string, metricName string, labels labels.Labels, chunkID string) ([]string, [][]index.Entry, error)
}

type Writer

type Writer struct {
	DisableIndexDeduplication bool
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(fetcher *fetcher.Fetcher, schemaCfg config.SchemaConfig, indexWriter IndexWriter, schema SchemaWrites, writeDedupeCache cache.Cache, disableIndexDeduplication bool) *Writer

func (*Writer) Put

func (c *Writer) Put(ctx context.Context, chunks []chunk.Chunk) error

Put implements Store

func (*Writer) PutOne

func (c *Writer) PutOne(ctx context.Context, from, through model.Time, chk chunk.Chunk) error

PutOne implements Store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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