Documentation
¶
Index ¶
- Constants
- Variables
- func NewAggregateStatsReporter(stats *[]storepb.SeriesStatsCounter) seriesStatsReporter
- func NewPromSeriesSet(seriesSet storepb.SeriesSet, mint, maxt int64, aggrs []storepb.Aggr, ...) storage.SeriesSet
- func NewRemoteEndpoints(logger log.Logger, getClients func() []Client, opts Opts) api.RemoteEndpoints
- func NewRemoteEngine(logger log.Logger, queryClient Client, opts Opts) *remoteEngine
- type Client
- type EndpointSet
- func (e *EndpointSet) Close()
- func (e *EndpointSet) GetEndpointStatus() []EndpointStatus
- func (e *EndpointSet) GetExemplarsStores() []*exemplarspb.ExemplarStore
- func (e *EndpointSet) GetMetricMetadataClients() []metadatapb.MetadataClient
- func (e *EndpointSet) GetQueryAPIClients() []Client
- func (e *EndpointSet) GetRulesClients() []rulespb.RulesClient
- func (e *EndpointSet) GetStoreClients() []store.Client
- func (e *EndpointSet) GetTargetsClients() []targetspb.TargetsClient
- func (e *EndpointSet) Update(ctx context.Context)
- type EndpointStatus
- type GRPCEndpointSpec
- type Opts
- type QueryableCreator
- type RemoteEndpointsCreator
Constants ¶
const (
ExternalLabels queryConnMetricLabel = "external_labels"
StoreType queryConnMetricLabel = "store_type"
)
Variables ¶
var NoopSeriesStatsReporter seriesStatsReporter = func(_ storepb.SeriesStatsCounter) {}
Functions ¶
func NewAggregateStatsReporter ¶ added in v0.29.0
func NewAggregateStatsReporter(stats *[]storepb.SeriesStatsCounter) seriesStatsReporter
func NewPromSeriesSet ¶ added in v0.35.0
func NewPromSeriesSet(seriesSet storepb.SeriesSet, mint, maxt int64, aggrs []storepb.Aggr, warns annotations.Annotations) storage.SeriesSet
NewPromSeriesSet constructs a promSeriesSet.
func NewRemoteEndpoints ¶ added in v0.31.0
func NewRemoteEndpoints(logger log.Logger, getClients func() []Client, opts Opts) api.RemoteEndpoints
func NewRemoteEngine ¶ added in v0.34.0
func NewRemoteEngine(logger log.Logger, queryClient Client, opts Opts) *remoteEngine
Types ¶
type Client ¶ added in v0.31.0
type Client struct {
querypb.QueryClient
// contains filtered or unexported fields
}
Client is a query client that executes PromQL queries.
func NewClient ¶ added in v0.31.0
func NewClient(queryClient querypb.QueryClient, address string, tsdbInfos infopb.TSDBInfos) Client
NewClient creates a new Client.
func (Client) GetAddress ¶ added in v0.31.0
func (c Client) GetAddress() string
type EndpointSet ¶ added in v0.23.0
type EndpointSet struct {
// contains filtered or unexported fields
}
EndpointSet maintains a set of active Thanos endpoints. It is backed up by Endpoint Specifications that are dynamically fetched on every Update() call.
func NewEndpointSet ¶ added in v0.23.0
func NewEndpointSet(
now nowFunc,
logger log.Logger,
reg prometheus.Registerer,
endpointSpecs func() []*GRPCEndpointSpec,
unhealthyEndpointTimeout time.Duration,
endpointInfoTimeout time.Duration,
endpointMetricLabels ...string,
) *EndpointSet
NewEndpointSet returns a new set of Thanos APIs.
func (*EndpointSet) GetEndpointStatus ¶ added in v0.23.0
func (e *EndpointSet) GetEndpointStatus() []EndpointStatus
func (*EndpointSet) GetExemplarsStores ¶ added in v0.23.0
func (e *EndpointSet) GetExemplarsStores() []*exemplarspb.ExemplarStore
GetExemplarsStores returns a list of all active exemplars stores.
func (*EndpointSet) GetMetricMetadataClients ¶ added in v0.23.0
func (e *EndpointSet) GetMetricMetadataClients() []metadatapb.MetadataClient
GetMetricMetadataClients returns a list of all active metadata clients.
func (*EndpointSet) GetQueryAPIClients ¶ added in v0.26.0
func (e *EndpointSet) GetQueryAPIClients() []Client
GetQueryAPIClients returns a list of all active query API clients.
func (*EndpointSet) GetRulesClients ¶ added in v0.23.0
func (e *EndpointSet) GetRulesClients() []rulespb.RulesClient
GetRulesClients returns a list of all active rules clients.
func (*EndpointSet) GetStoreClients ¶ added in v0.23.0
func (e *EndpointSet) GetStoreClients() []store.Client
GetStoreClients returns a list of all active stores.
func (*EndpointSet) GetTargetsClients ¶ added in v0.23.0
func (e *EndpointSet) GetTargetsClients() []targetspb.TargetsClient
GetTargetsClients returns a list of all active targets clients.
func (*EndpointSet) Update ¶ added in v0.23.0
func (e *EndpointSet) Update(ctx context.Context)
Update updates the endpoint set. It fetches current list of endpoint specs from function and updates the fresh metadata from all endpoints. Keeps around statically defined nodes that were defined with the strict mode.
type EndpointStatus ¶ added in v0.23.0
type EndpointStatus struct {
Name string `json:"name"`
LastCheck time.Time `json:"lastCheck"`
LastError *stringError `json:"lastError"`
LabelSets []labels.Labels `json:"labelSets"`
ComponentType component.Component `json:"-"`
MinTime int64 `json:"minTime"`
MaxTime int64 `json:"maxTime"`
}
type GRPCEndpointSpec ¶ added in v0.24.0
type GRPCEndpointSpec struct {
// contains filtered or unexported fields
}
func NewGRPCEndpointSpec ¶ added in v0.23.0
func NewGRPCEndpointSpec(addr string, isStrictStatic bool, dialOpts ...grpc.DialOption) *GRPCEndpointSpec
NewGRPCEndpointSpec creates gRPC endpoint spec. It uses InfoAPI to get Metadata.
type Opts ¶ added in v0.31.0
type Opts struct {
AutoDownsample bool
ReplicaLabels []string
PartitionLabels []string
Timeout time.Duration
PartialResponse bool
QueryDistributedWithOverlappingInterval bool
}
Opts are the options for a PromQL query.
type QueryableCreator ¶
type QueryableCreator func(
deduplicate bool,
replicaLabels []string,
storeDebugMatchers [][]*labels.Matcher,
maxResolutionMillis int64,
partialResponse,
skipChunks bool,
shardInfo *storepb.ShardInfo,
seriesStatsReporter seriesStatsReporter,
) storage.Queryable
QueryableCreator returns implementation of promql.Queryable that fetches data from the proxy store API endpoints. If deduplication is enabled, all data retrieved from it will be deduplicated along all replicaLabels by default. When the replicaLabels argument is not empty it overwrites the global replicaLabels flag. This allows specifying replicaLabels at query time. maxResolutionMillis controls downsampling resolution that is allowed (specified in milliseconds). partialResponse controls `partialResponseDisabled` option of StoreAPI and partial response behavior of proxy.
func NewQueryableCreator ¶
func NewQueryableCreator(
logger log.Logger,
reg prometheus.Registerer,
proxy storepb.StoreServer,
maxConcurrentSelects int,
selectTimeout time.Duration,
deduplicationFunc string,
) QueryableCreator
NewQueryableCreator creates QueryableCreator. NOTE(bwplotka): Proxy assumes to be replica_aware, see thanos.store.info.StoreInfo.replica_aware field.
type RemoteEndpointsCreator ¶ added in v0.38.0
type RemoteEndpointsCreator func(
replicaLabels []string,
partialResponse bool,
) api.RemoteEndpoints
func NewRemoteEndpointsCreator ¶ added in v0.38.0
func NewRemoteEndpointsCreator(
logger log.Logger,
getEndpoints func() []Client,
partitionLabels []string,
timeout time.Duration,
queryDistributedWithOverlappingInterval bool,
autoDownsample bool,
) RemoteEndpointsCreator