v1

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 40 Imported by: 4

Documentation

Index

Constants

View Source
const (
	DedupParam               = "dedup"
	PartialResponseParam     = "partial_response"
	MaxSourceResolutionParam = "max_source_resolution"
	ReplicaLabelsParam       = "replicaLabels[]"
	MatcherParam             = "match[]"
	StoreMatcherParam        = "storeMatch[]"
	Step                     = "step"
	Stats                    = "stats"
)

Variables

This section is empty.

Functions

func NewExemplarsHandler added in v0.20.0

func NewExemplarsHandler(client exemplars.UnaryClient, enablePartialResponse bool) func(*http.Request) (interface{}, []error, *api.ApiError)

NewExemplarsHandler creates handler compatible with HTTP /api/v1/query_exemplars https://prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars which uses gRPC Unary Exemplars API.

func NewMetricMetadataHandler added in v0.19.0

func NewMetricMetadataHandler(client metadata.UnaryClient, enablePartialResponse bool) func(*http.Request) (interface{}, []error, *api.ApiError)

NewMetricMetadataHandler creates handler compatible with HTTP /api/v1/metadata https://prometheus.io/docs/prometheus/latest/querying/api/#querying-metric-metadata which uses gRPC Unary Metadata API.

func NewRulesHandler

func NewRulesHandler(client rules.UnaryClient, enablePartialResponse bool) func(*http.Request) (interface{}, []error, *api.ApiError)

NewRulesHandler created handler compatible with HTTP /api/v1/rules https://prometheus.io/docs/prometheus/latest/querying/api/#rules which uses gRPC Unary Rules API.

func NewTargetsHandler added in v0.20.0

func NewTargetsHandler(client targets.UnaryClient, enablePartialResponse bool) func(*http.Request) (interface{}, []error, *api.ApiError)

NewTargetsHandler created handler compatible with HTTP /api/v1/targets https://prometheus.io/docs/prometheus/latest/querying/api/#targets which uses gRPC Unary Targets API.

func RegisterQueryServer added in v0.26.0

func RegisterQueryServer(queryServer querypb.QueryServer) func(*grpc.Server)

Types

type GRPCAPI added in v0.26.0

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

func NewGRPCAPI added in v0.26.0

func NewGRPCAPI(now func() time.Time, replicaLabels []string, creator query.QueryableCreator, queryEngine func(int64) *promql.Engine, defaultMaxResolutionSeconds time.Duration) *GRPCAPI

func (*GRPCAPI) Query added in v0.26.0

func (g *GRPCAPI) Query(request *querypb.QueryRequest, server querypb.Query_QueryServer) error

func (*GRPCAPI) QueryRange added in v0.26.0

type QueryAPI

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

QueryAPI is an API used by Thanos Querier.

func NewQueryAPI

func NewQueryAPI(
	logger log.Logger,
	endpointStatus func() []query.EndpointStatus,
	qe func(int64) *promql.Engine,
	c query.QueryableCreator,
	ruleGroups rules.UnaryClient,
	targets targets.UnaryClient,
	metadatas metadata.UnaryClient,
	exemplars exemplars.UnaryClient,
	enableAutodownsampling bool,
	enableQueryPartialResponse bool,
	enableRulePartialResponse bool,
	enableTargetPartialResponse bool,
	enableMetricMetadataPartialResponse bool,
	enableExemplarPartialResponse bool,
	enableQueryPushdown bool,
	replicaLabels []string,
	flagsMap map[string]string,
	defaultRangeQueryStep time.Duration,
	defaultInstantQueryMaxSourceResolution time.Duration,
	defaultMetadataTimeRange time.Duration,
	disableCORS bool,
	gate gate.Gate,
	reg *prometheus.Registry,
) *QueryAPI

NewQueryAPI returns an initialized QueryAPI type.

func (*QueryAPI) Register

func (qapi *QueryAPI) Register(r *route.Router, tracer opentracing.Tracer, logger log.Logger, ins extpromhttp.InstrumentationMiddleware, logMiddleware *logging.HTTPServerMiddleware)

Register the API's endpoints in the given router.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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