Documentation ¶
Overview ¶
Package query api query
Package query for query
Index ¶
- Constants
- Variables
- func NewQueryEngine(reg *prometheus.Registry, logKit blog.GlogKit) func(int64) *promql.Engine
- func NewQueryableCreator(reg *prometheus.Registry, logKit blog.GlogKit, ...) query.QueryableCreator
- type DiscoveryClient
- type EmptyExemplarClient
- type EmptyMetadataClient
- type EmptyRuleClient
- type EmptyTargetClient
- type HTTPSDClient
- type HTTPSDClientGroup
- type QueryAPI
- type TenantAuthMiddleware
Constants ¶
const (
// LabelMatcherParam labelMatch
LabelMatcherParam = "labelMatch[]"
)
Variables ¶
var ErrNotImplement = errors.New("api not implement")
ErrNotImplement xxx
Functions ¶
func NewQueryEngine ¶
NewQueryEngine xxx
func NewQueryableCreator ¶
func NewQueryableCreator(reg *prometheus.Registry, logKit blog.GlogKit, discoveryClient *DiscoveryClient) query.QueryableCreator
NewQueryableCreator xxx
Types ¶
type DiscoveryClient ¶
type DiscoveryClient struct {
// contains filtered or unexported fields
}
DiscoveryClient 支持的服务发现, 包含静态配置, http-sd, 命令行和配置文件来源
func NewDiscoveryClient ¶
func NewDiscoveryClient(ctx context.Context, reg *prometheus.Registry, tracer opentracing.Tracer, logKit blog.GlogKit, strictStoreList []string, storeList []string, httpSDURLs []string, g *run.Group) (*DiscoveryClient, error)
NewDiscoveryClient xxx
func (*DiscoveryClient) Addresses ¶
func (c *DiscoveryClient) Addresses() []string
Addresses 服务发现所有地址
func (*DiscoveryClient) Endpoints ¶
func (c *DiscoveryClient) Endpoints() *query.EndpointSet
Endpoints 返回 EndpointSet
func (*DiscoveryClient) ForceRefreshEndpoints ¶
func (c *DiscoveryClient) ForceRefreshEndpoints(ctx context.Context)
ForceRefreshEndpoints xxx
type EmptyExemplarClient ¶
type EmptyExemplarClient struct{}
EmptyExemplarClient empty exemplar client
func NewEmptyExemplarClient ¶
func NewEmptyExemplarClient() *EmptyExemplarClient
NewEmptyExemplarClient :
func (*EmptyExemplarClient) Exemplars ¶
func (e *EmptyExemplarClient) Exemplars(_ context.Context, _ *exemplarspb.ExemplarsRequest) ( []*exemplarspb.ExemplarData, storage.Warnings, error)
Exemplars :
type EmptyMetadataClient ¶
type EmptyMetadataClient struct{}
EmptyMetadataClient empty metadata client
func NewEmptyMetaDataClient ¶
func NewEmptyMetaDataClient() *EmptyMetadataClient
NewEmptyMetaDataClient xxx
func (*EmptyMetadataClient) MetricMetadata ¶
func (e *EmptyMetadataClient) MetricMetadata(_ context.Context, _ *metadatapb.MetricMetadataRequest) ( map[string][]metadatapb.Meta, storage.Warnings, error)
MetricMetadata :
type EmptyRuleClient ¶
type EmptyRuleClient struct{}
EmptyRuleClient empty rule client
func (*EmptyRuleClient) Rules ¶
func (e *EmptyRuleClient) Rules(_ context.Context, _ *rulespb.RulesRequest) (*rulespb.RuleGroups, storage.Warnings, error)
Rules :
type EmptyTargetClient ¶
type EmptyTargetClient struct{}
EmptyTargetClient empty target client
func (*EmptyTargetClient) Targets ¶
func (e *EmptyTargetClient) Targets(_ context.Context, _ *targetspb.TargetsRequest) (*targetspb.TargetDiscovery, storage.Warnings, error)
Targets :
type HTTPSDClient ¶
type HTTPSDClient struct {
// contains filtered or unexported fields
}
HTTPSDClient http sd client
func NewHTTPSDClient ¶
func NewHTTPSDClient( ctx context.Context, logKit blog.GlogKit, conf httpdiscovery.SDConfig, addr string, u url.URL, forceRefreshFunc func(ctx context.Context)) (*HTTPSDClient, error)
NewHTTPSDClient xxx
type HTTPSDClientGroup ¶
type HTTPSDClientGroup struct {
// contains filtered or unexported fields
}
HTTPSDClientGroup http sd client group
func NewHTTPSDClientGroup ¶
func NewHTTPSDClientGroup(ctx context.Context, logKit blog.GlogKit, reg *prometheus.Registry, conf *httpdiscovery.SDConfig, g *run.Group, forceRefreshFunc func(ctx context.Context)) (*HTTPSDClientGroup, error)
NewHTTPSDClientGroup xxx
func (*HTTPSDClientGroup) Addresses ¶
func (c *HTTPSDClientGroup) Addresses() []string
Addresses xxx
type QueryAPI ¶
type QueryAPI struct { StoresList []string // contains filtered or unexported fields }
QueryAPI promql api 服务, 封装 thaons 的API使用
func NewQueryAPI ¶
func NewQueryAPI(ctx context.Context, reg *prometheus.Registry, tracer opentracing.Tracer, logKit blog.GlogKit, httpAddr string, httpPort string, addrIPv6 string, strictStoreList []string, storeList []string, httpSDURLs []string, g *run.Group, ) (*QueryAPI, error)
NewQueryAPI 这个包对thanos的query做一些封装,重新调用等 使用配置文件配置 启动 query 模块,暴露http query模块对应我们的store
type TenantAuthMiddleware ¶
type TenantAuthMiddleware struct {
// contains filtered or unexported fields
}
TenantAuthMiddleware tenant auth middleware
func NewTenantAuthMiddleware ¶
func NewTenantAuthMiddleware(ctx context.Context, ins extpromhttp.InstrumentationMiddleware) (*TenantAuthMiddleware, error)
NewTenantAuthMiddleware 租户鉴权中间件
func (*TenantAuthMiddleware) NewHandler ¶
func (t *TenantAuthMiddleware) NewHandler(handlerName string, handler http.Handler) http.HandlerFunc
NewHandler 处理函数