initQueryable instantiates the queryable and promQL engine used to service queries to Cortex. It also registers the API endpoints associated with those two services.
()
| 287 | // initQueryable instantiates the queryable and promQL engine used to service queries to |
| 288 | // Cortex. It also registers the API endpoints associated with those two services. |
| 289 | func (t *Cortex) initQueryable() (serv services.Service, err error) { |
| 290 | querierRegisterer := prometheus.WrapRegistererWith(prometheus.Labels{"engine": "querier"}, prometheus.DefaultRegisterer) |
| 291 | |
| 292 | // Create a querier queryable and PromQL engine |
| 293 | t.QuerierQueryable, t.ExemplarQueryable, t.QuerierEngine = querier.New(t.Cfg.Querier, t.OverridesConfig, t.Distributor, t.StoreQueryables, querierRegisterer, util_log.Logger, t.OverridesConfig.QueryPartialData) |
| 294 | |
| 295 | // Use distributor as default MetadataQuerier |
| 296 | t.MetadataQuerier = t.Distributor |
| 297 | |
| 298 | // Register the default endpoints that are always enabled for the querier module |
| 299 | t.API.RegisterQueryable(t.QuerierQueryable, t.Distributor) |
| 300 | |
| 301 | return nil, nil |
| 302 | } |
| 303 | |
| 304 | // Enable merge querier if multi tenant query federation is enabled |
| 305 | func (t *Cortex) initTenantFederation() (serv services.Service, err error) { |
nothing calls this directly
no test coverage detected