querier

package
v0.0.0-...-39c03fc Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: AGPL-3.0 Imports: 44 Imported by: 0

README

Querier

The querier is responsible for handling requests to load data. These services are not addressed directly instead each instance will connect to the frontend services and poll for queries. Each query is then executed and the response encoded and returned to the front end.

Documentation

Index

Constants

View Source
const (
	BlockStartKey = "blockStart"
	BlockEndKey   = "blockEnd"
	QueryModeKey  = "mode"

	QueryModeIngesters = "ingesters"
	QueryModeBlocks    = "blocks"
	QueryModeAll       = "all"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Search             SearchConfig       `yaml:"search"`
	SnapshotByIDConfig SnapshotByIDConfig `yaml:"snapshot_by_id"`

	ExtraQueryDelay        time.Duration `yaml:"extra_query_delay,omitempty"`
	MaxConcurrentQueries   int           `yaml:"max_concurrent_queries"`
	Worker                 worker.Config `yaml:"frontend_worker"`
	QueryRelevantIngesters bool          `yaml:"query_relevant_ingesters"`
}

Config for a querier.

func (*Config) RegisterFlagsAndApplyDefaults

func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet)

RegisterFlagsAndApplyDefaults register flags.

type Querier

type Querier struct {
	services.Service
	// contains filtered or unexported fields
}

Querier handlers queries.

func New

func New(cfg Config, clientCfg ingester_client.Config, ring ring.ReadRing, store storage.Store, limits *overrides.Overrides) (*Querier, error)

New makes a new Querier.

func (*Querier) CreateAndRegisterWorker

func (q *Querier) CreateAndRegisterWorker(handler http.Handler) error

func (*Querier) FindSnapshotByID

func (q *Querier) FindSnapshotByID(ctx context.Context, req *deeppb.SnapshotByIDRequest, timeStart int64, timeEnd int64) (*deeppb.SnapshotByIDResponse, error)

func (*Querier) RegisterSubservices

func (q *Querier) RegisterSubservices(s ...services.Service) error

func (*Querier) SearchBlock

SearchBlock searches the specified subset of the block for the passed tags.

func (*Querier) SearchHandler

func (q *Querier) SearchHandler(w http.ResponseWriter, r *http.Request)

func (*Querier) SearchRecent

func (q *Querier) SearchRecent(ctx context.Context, req *deeppb.SearchRequest) (*deeppb.SearchResponse, error)

func (*Querier) SearchTagValues

func (*Querier) SearchTagValuesHandler

func (q *Querier) SearchTagValuesHandler(w http.ResponseWriter, r *http.Request)

func (*Querier) SearchTagValuesV2

func (*Querier) SearchTagValuesV2Handler

func (q *Querier) SearchTagValuesV2Handler(w http.ResponseWriter, r *http.Request)

func (*Querier) SearchTags

func (*Querier) SearchTagsHandler

func (q *Querier) SearchTagsHandler(w http.ResponseWriter, r *http.Request)

func (*Querier) SnapshotByIdHandler

func (q *Querier) SnapshotByIdHandler(w http.ResponseWriter, r *http.Request)

type SearchConfig

type SearchConfig struct {
	QueryTimeout      time.Duration `yaml:"query_timeout"`
	PreferSelf        int           `yaml:"prefer_self"`
	ExternalEndpoints []string      `yaml:"external_endpoints"`
	HedgeRequestsAt   time.Duration `yaml:"external_hedge_requests_at"`
	HedgeRequestsUpTo int           `yaml:"external_hedge_requests_up_to"`
}

type SnapshotByIDConfig

type SnapshotByIDConfig struct {
	QueryTimeout time.Duration `yaml:"query_timeout"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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