vmselectapi

package
v1.103.0-cluster Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// InitSearch initialize series search for the given sq.
	//
	// The returned BlockIterator must be closed with MustClose to free up resources when it is no longer needed.
	InitSearch(qt *querytracer.Tracer, sq *storage.SearchQuery, deadline uint64) (BlockIterator, error)

	// SearchMetricNames returns metric names matching the given sq.
	SearchMetricNames(qt *querytracer.Tracer, sq *storage.SearchQuery, deadline uint64) ([]string, error)

	// LabelValues returns values for labelName label acorss series matching the given sq.
	LabelValues(qt *querytracer.Tracer, sq *storage.SearchQuery, labelName string, maxLabelValues int, deadline uint64) ([]string, error)

	// TagValueSuffixes returns tag value suffixes for the given args.
	TagValueSuffixes(qt *querytracer.Tracer, accountID, projectID uint32, tr storage.TimeRange, tagKey, tagValuePrefix string, delimiter byte, maxSuffixes int, deadline uint64) ([]string, error)

	// LabelNames returns lable names for series matching the given sq.
	LabelNames(qt *querytracer.Tracer, sq *storage.SearchQuery, maxLableNames int, deadline uint64) ([]string, error)

	// SeriesCount returns the number of series for the given (accountID, projectID).
	SeriesCount(qt *querytracer.Tracer, accountID, projectID uint32, deadline uint64) (uint64, error)

	// TSDBStatus returns tsdb status for the given sq.
	TSDBStatus(qt *querytracer.Tracer, sq *storage.SearchQuery, focusLabel string, topN int, deadline uint64) (*storage.TSDBStatus, error)

	// DeleteSeries deletes series matching the given sq.
	DeleteSeries(qt *querytracer.Tracer, sq *storage.SearchQuery, deadline uint64) (int, error)

	// RegisterMetricNames registers the given mrs in the storage.
	RegisterMetricNames(qt *querytracer.Tracer, mrs []storage.MetricRow, deadline uint64) error

	// Tenants returns list of tenants in the storage on the given tr.
	Tenants(qt *querytracer.Tracer, tr storage.TimeRange, deadline uint64) ([]string, error)
}

API must implement vmselect API.

type BlockIterator

type BlockIterator interface {
	// NextBlock reads the next block into mb.
	//
	// It returns true on success, false on error or if no blocks to read.
	NextBlock(mb *storage.MetricBlock) bool

	// MustClose frees up resources allocated by BlockIterator.
	MustClose()

	// Error returns the last error occurred in NextBlock(), which returns false.
	Error() error
}

BlockIterator must iterate through series blocks found by VMSelect.InitSearch.

MustClose must be called in order to free up allocated resources when BlockIterator is no longer needed.

type Limits

type Limits struct {
	// MaxLabelNames is the maximum label names, which may be returned from labelNames request.
	MaxLabelNames int

	// MaxLabelValues is the maximum label values, which may be returned from labelValues request.
	MaxLabelValues int

	// MaxTagValueSuffixes is the maximum number of entries, which can be returned from tagValueSuffixes request.
	MaxTagValueSuffixes int

	// MaxConcurrentRequests is the maximum number of concurrent requests a server can process.
	//
	// The remaining requests wait for up to MaxQueueDuration for their execution.
	MaxConcurrentRequests int

	// MaxConcurrentRequestsFlagName is the name for the flag containing the MaxConcurrentRequests value.
	MaxConcurrentRequestsFlagName string

	// MaxQueueDuration is the maximum duration to wait if MaxConcurrentRequests are executed.
	MaxQueueDuration time.Duration

	// MaxQueueDurationFlagName is the name for the flag containing the MaxQueueDuration value.
	MaxQueueDurationFlagName string
}

Limits contains various limits for Server.

type Server

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

Server processes vmselect requests.

func NewServer

func NewServer(addr string, api API, limits Limits, disableResponseCompression bool) (*Server, error)

NewServer starts new Server at the given addr, which serves the given api with the given limits.

If disableResponseCompression is set to true, then the returned server doesn't compress responses.

func (*Server) MustStop

func (s *Server) MustStop()

MustStop gracefully stops s, so it no longer touches s.api after returning.

Jump to

Keyboard shortcuts

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