Documentation
¶
Index ¶
- Constants
- func DefaultConfigHandler(actualCfg any, defaultCfg any) http.HandlerFunc
- func NewQuerierHandler(cfg Config, querierCfg querier.Config, ...) http.Handler
- type API
- func (a *API) RegisterAPI(httpPathPrefix string, actualCfg any, defaultCfg any)
- func (a *API) RegisterAlertmanager(am *alertmanager.MultitenantAlertmanager, target, apiEnabled bool)
- func (a *API) RegisterCompactor(c *compactor.Compactor)
- func (a *API) RegisterDistributor(d *distributor.Distributor, pushConfig distributor.Config, ...)
- func (a *API) RegisterIngester(i Ingester, pushConfig distributor.Config)
- func (a *API) RegisterMemberlistKV(handler http.Handler)
- func (a *API) RegisterQueryAPI(handler http.Handler)
- func (a *API) RegisterQueryFrontend1(f *frontendv1.Frontend)
- func (a *API) RegisterQueryFrontend2(f *frontendv2.Frontend)
- func (a *API) RegisterQueryFrontendHandler(h http.Handler)
- func (a *API) RegisterQueryScheduler(f *scheduler.Scheduler)
- func (a *API) RegisterQueryable(queryable storage.SampleAndChunkQueryable, distributor Distributor)
- func (a *API) RegisterRing(r *ring.Ring)
- func (a *API) RegisterRoute(path string, handler http.Handler, auth bool, method string, methods ...string)
- func (a *API) RegisterRoutesWithPrefix(prefix string, handler http.Handler, auth bool, methods ...string)
- func (a *API) RegisterRuler(r *ruler.Ruler)
- func (a *API) RegisterRulerAPI(r *ruler.API)
- func (a *API) RegisterRuntimeConfig(runtimeConfigHandler http.HandlerFunc)
- func (a *API) RegisterServiceMapHandler(handler http.Handler)
- func (a *API) RegisterStoreGateway(s *storegateway.StoreGateway)
- func (a *API) RegisterTenantDeletion(api *purger.TenantDeletionAPI)
- type Config
- type ConfigHandler
- type Distributor
- type DistributorPushWrapper
- type HTTPHeaderMiddleware
- type IndexPageContent
- type Ingester
Constants ¶
const ( SectionAdminEndpoints = "Admin Endpoints:" SectionDangerous = "Dangerous:" )
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigHandler ¶ added in v1.10.0
func DefaultConfigHandler(actualCfg any, defaultCfg any) http.HandlerFunc
func NewQuerierHandler ¶ added in v1.5.0
func NewQuerierHandler( cfg Config, querierCfg querier.Config, queryable storage.SampleAndChunkQueryable, exemplarQueryable storage.ExemplarQueryable, engine engine.QueryEngine, metadataQuerier querier.MetadataQuerier, reg prometheus.Registerer, logger log.Logger, ) http.Handler
NewQuerierHandler returns a HTTP handler that can be used by the querier service to either register with the frontend worker query processor or with the external HTTP server to fulfill the Prometheus query API.
Types ¶
type API ¶
type API struct {
AuthMiddleware middleware.Interface
HTTPHeaderMiddleware *HTTPHeaderMiddleware
// contains filtered or unexported fields
}
func (*API) RegisterAPI ¶
RegisterAPI registers the standard endpoints associated with a running Cortex.
func (*API) RegisterAlertmanager ¶
func (a *API) RegisterAlertmanager(am *alertmanager.MultitenantAlertmanager, target, apiEnabled bool)
RegisterAlertmanager registers endpoints associated with the alertmanager. It will only serve endpoints using the legacy http-prefix if it is not run as a single binary.
func (*API) RegisterCompactor ¶
RegisterCompactor registers the ring UI page associated with the compactor.
func (*API) RegisterDistributor ¶
func (a *API) RegisterDistributor(d *distributor.Distributor, pushConfig distributor.Config, overrides *validation.Overrides)
RegisterDistributor registers the endpoints associated with the distributor.
func (*API) RegisterIngester ¶
func (a *API) RegisterIngester(i Ingester, pushConfig distributor.Config)
RegisterIngester registers the ingesters HTTP and GRPC service
func (*API) RegisterMemberlistKV ¶ added in v1.7.0
func (*API) RegisterQueryAPI ¶ added in v1.5.0
RegisterQueryAPI registers the Prometheus API routes with the provided handler.
func (*API) RegisterQueryFrontend1 ¶ added in v1.6.0
func (a *API) RegisterQueryFrontend1(f *frontendv1.Frontend)
func (*API) RegisterQueryFrontend2 ¶ added in v1.6.0
func (a *API) RegisterQueryFrontend2(f *frontendv2.Frontend)
func (*API) RegisterQueryFrontendHandler ¶ added in v1.6.0
RegisterQueryFrontendHandler registers the Prometheus routes supported by the Cortex querier service. Currently, this can not be registered simultaneously with the Querier.
func (*API) RegisterQueryScheduler ¶ added in v1.6.0
func (*API) RegisterQueryable ¶ added in v1.5.0
func (a *API) RegisterQueryable( queryable storage.SampleAndChunkQueryable, distributor Distributor, )
RegisterQueryable registers the default routes associated with the querier module.
func (*API) RegisterRing ¶
RegisterRing registers the ring UI page associated with the distributor for writes.
func (*API) RegisterRoute ¶
func (a *API) RegisterRoute(path string, handler http.Handler, auth bool, method string, methods ...string)
RegisterRoute registers a single route enforcing HTTP methods. A single route is expected to be specific about which HTTP methods are supported.
func (*API) RegisterRoutesWithPrefix ¶
func (*API) RegisterRuler ¶
RegisterRuler registers routes associated with the Ruler service.
func (*API) RegisterRulerAPI ¶ added in v1.5.0
RegisterRulerAPI registers routes associated with the Ruler API
func (*API) RegisterRuntimeConfig ¶ added in v1.7.0
func (a *API) RegisterRuntimeConfig(runtimeConfigHandler http.HandlerFunc)
RegisterRuntimeConfig registers the endpoints associates with the runtime configuration
func (*API) RegisterServiceMapHandler ¶
RegisterServiceMapHandler registers the Cortex structs service handler TODO: Refactor this code to be accomplished using the services.ServiceManager or a future module manager #2291
func (*API) RegisterStoreGateway ¶
func (a *API) RegisterStoreGateway(s *storegateway.StoreGateway)
RegisterStoreGateway registers the ring UI page associated with the store-gateway.
func (*API) RegisterTenantDeletion ¶ added in v1.8.0
func (a *API) RegisterTenantDeletion(api *purger.TenantDeletionAPI)
type Config ¶
type Config struct {
ResponseCompression bool `yaml:"response_compression_enabled"`
AlertmanagerHTTPPrefix string `yaml:"alertmanager_http_prefix"`
PrometheusHTTPPrefix string `yaml:"prometheus_http_prefix"`
// The following configs are injected by the upstream caller.
ServerPrefix string `yaml:"-"`
LegacyHTTPPrefix string `yaml:"-"`
HTTPAuthMiddleware middleware.Interface `yaml:"-"`
// This allows downstream projects to wrap the distributor push function
// and access the deserialized write requests before/after they are pushed.
DistributorPushWrapper DistributorPushWrapper `yaml:"-"`
// The CustomConfigHandler allows for providing a different handler for the
// `/config` endpoint. If this field is set _before_ the API module is
// initialized, the custom config handler will be used instead of
// DefaultConfigHandler.
CustomConfigHandler ConfigHandler `yaml:"-"`
// Allows and is used to configure the addition of HTTP Header fields to logs
HTTPRequestHeadersToLog flagext.StringSlice `yaml:"http_request_headers_to_log"`
// HTTP header that can be used as request id. It will always be included in logs
// If it's not provided, or this header is empty, then random requestId will be generated
RequestIdHeader string `yaml:"request_id_header"`
QuerierDefaultCodec string `yaml:"querier_default_codec"`
// contains filtered or unexported fields
}
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet.
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet with the set prefix.
type ConfigHandler ¶ added in v1.10.0
type ConfigHandler func(actualCfg any, defaultCfg any) http.HandlerFunc
type Distributor ¶ added in v1.10.0
type Distributor interface {
querier.Distributor
UserStatsHandler(w http.ResponseWriter, r *http.Request)
}
type DistributorPushWrapper ¶ added in v1.8.0
DistributorPushWrapper wraps around a push. It is similar to middleware.Interface.
type HTTPHeaderMiddleware ¶ added in v1.14.0
HTTPHeaderMiddleware adds specified HTTPHeaders to the request context
type IndexPageContent ¶ added in v1.4.0
type IndexPageContent struct {
// contains filtered or unexported fields
}
IndexPageContent is a map of sections to path -> description.
func (*IndexPageContent) AddLink ¶ added in v1.4.0
func (pc *IndexPageContent) AddLink(section, path, description string)
func (*IndexPageContent) GetContent ¶ added in v1.4.0
func (pc *IndexPageContent) GetContent() map[string]map[string]string
type Ingester ¶ added in v1.5.0
type Ingester interface {
client.IngesterServer
FlushHandler(http.ResponseWriter, *http.Request)
ShutdownHandler(http.ResponseWriter, *http.Request)
RenewTokenHandler(http.ResponseWriter, *http.Request)
AllUserStatsHandler(http.ResponseWriter, *http.Request)
ModeHandler(http.ResponseWriter, *http.Request)
Push(context.Context, *cortexpb.WriteRequest) (*cortexpb.WriteResponse, error)
}
Ingester is defined as an interface to allow for alternative implementations of ingesters to be passed into the API.RegisterIngester() method.