api

package
v0.0.0-...-2ecc15d Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: AGPL-3.0 Imports: 61 Imported by: 0

Documentation

Index

Constants

View Source
const OTLPPushEndpoint = "/otlp/v1/metrics"
View Source
const PrometheusPushEndpoint = "/api/v1/push"

Variables

This section is empty.

Functions

func DefaultConfigHandler

func DefaultConfigHandler(actualCfg interface{}, defaultCfg interface{}) http.HandlerFunc

func NewQuerierHandler

func NewQuerierHandler(
	cfg Config,
	queryable storage.SampleAndChunkQueryable,
	exemplarQueryable storage.ExemplarQueryable,
	metadataSupplier querier.MetadataSupplier,
	engine promql.QueryEngine,
	distributor Distributor,
	reg prometheus.Registerer,
	logger log.Logger,
	limits *validation.Overrides,
) 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
	// contains filtered or unexported fields
}

func New

func New(cfg Config, federationCfg tenantfederation.Config, serverCfg server.Config, s *server.Server, logger log.Logger) (*API, error)

func (*API) DisableServerHTTPTimeouts

func (a *API) DisableServerHTTPTimeouts(next http.Handler) http.Handler

func (*API) RegisterAPI

func (a *API) RegisterAPI(httpPathPrefix string, actualCfg interface{}, defaultCfg interface{}, buildInfoHandler http.Handler)

RegisterAPI registers the standard endpoints associated with a running Mimir.

func (*API) RegisterAlertmanager

func (a *API) RegisterAlertmanager(am *alertmanager.MultitenantAlertmanager, apiEnabled bool, grafanaCompatEnabled bool, buildInfoHandler http.Handler)

RegisterAlertmanager registers endpoints that are associated with the alertmanager.

func (*API) RegisterBlockBuilderScheduler

func (a *API) RegisterBlockBuilderScheduler(s bbschedulerpb.BlockBuilderSchedulerServer)

func (*API) RegisterCompactor

func (a *API) RegisterCompactor(c *compactor.MultitenantCompactor)

RegisterCompactor registers routes associated with the compactor.

func (*API) RegisterDeprecatedRoute

func (a *API) RegisterDeprecatedRoute(path string, handler http.Handler, auth, gzipEnabled bool, method string, methods ...string)

RegisterDeprecatedRoute behaves in a similar way to RegisterRoute. RegisterDeprecatedRoute also logs warnings on invocations of the deprecated endpoints.

func (*API) RegisterDistributor

func (a *API) RegisterDistributor(d *distributor.Distributor, pushConfig distributor.Config, reg prometheus.Registerer, limits *validation.Overrides)

RegisterDistributor registers the endpoints associated with the distributor.

func (*API) RegisterIngester

func (a *API) RegisterIngester(i Ingester)

RegisterIngester registers the ingester HTTP and gRPC services.

func (*API) RegisterIngesterPartitionRing

func (a *API) RegisterIngesterPartitionRing(r http.Handler)

RegisterIngesterPartitionRing registers the ring UI page associated with the ingester partitions ring.

func (*API) RegisterIngesterRing

func (a *API) RegisterIngesterRing(r http.Handler)

RegisterIngesterRing registers the ring UI page associated with the ingesters ring.

func (*API) RegisterMemberlistKV

func (a *API) RegisterMemberlistKV(pathPrefix string, kvs *memberlist.KVInitService)

func (*API) RegisterOverridesExporter

func (a *API) RegisterOverridesExporter(oe *exporter.OverridesExporter)

func (*API) RegisterQueryAPI

func (a *API) RegisterQueryAPI(handler http.Handler, buildInfoHandler http.Handler)

RegisterQueryAPI registers the Prometheus API routes with the provided handler.

func (*API) RegisterQueryFrontend1

func (a *API) RegisterQueryFrontend1(f *frontendv1.Frontend)

func (*API) RegisterQueryFrontend2

func (a *API) RegisterQueryFrontend2(f *frontendv2.Frontend)

func (*API) RegisterQueryFrontendHandler

func (a *API) RegisterQueryFrontendHandler(h http.Handler, buildInfoHandler http.Handler)

RegisterQueryFrontendHandler registers the Prometheus routes supported by the Mimir querier service. Currently, this can not be registered simultaneously with the Querier.

func (*API) RegisterQueryScheduler

func (a *API) RegisterQueryScheduler(f *scheduler.Scheduler)

func (*API) RegisterQueryable

func (a *API) RegisterQueryable(distributor Distributor)

RegisterQueryable registers the default routes associated with the querier module.

func (*API) RegisterRoute

func (a *API) RegisterRoute(path string, handler http.Handler, auth, gzipEnabled 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 (a *API) RegisterRoutesWithPrefix(prefix string, handler http.Handler, auth, gzipEnabled bool, methods ...string)

func (*API) RegisterRuler

func (a *API) RegisterRuler(r *ruler.Ruler)

RegisterRuler registers routes associated with the Ruler service.

func (*API) RegisterRulerAPI

func (a *API) RegisterRulerAPI(r *ruler.API, configAPIEnabled bool, buildInfoHandler http.Handler)

RegisterRulerAPI registers routes associated with the Ruler API

func (*API) RegisterRuntimeConfig

func (a *API) RegisterRuntimeConfig(runtimeConfigHandler http.HandlerFunc, userLimitsHandler http.HandlerFunc)

RegisterRuntimeConfig registers the endpoints associates with the runtime configuration

func (*API) RegisterServiceMapHandler

func (a *API) RegisterServiceMapHandler(handler http.Handler)

RegisterServiceMapHandler registers the Mimir 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.

type Config

type Config struct {
	SkipLabelNameValidationHeader  bool `yaml:"skip_label_name_validation_header_enabled" category:"advanced"`
	SkipLabelCountValidationHeader bool `yaml:"skip_label_count_validation_header_enabled" category:"advanced"`

	AlertmanagerHTTPPrefix string `yaml:"alertmanager_http_prefix" category:"advanced"`
	PrometheusHTTPPrefix   string `yaml:"prometheus_http_prefix" category:"advanced"`

	// The following configs are injected by the upstream caller.
	ServerPrefix       string               `yaml:"-"`
	HTTPAuthMiddleware middleware.Interface `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:"-"`
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet.

func (*Config) RegisterFlagsWithPrefix

func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet with the set prefix.

type ConfigHandler

type ConfigHandler func(actualCfg interface{}, defaultCfg interface{}) http.HandlerFunc

type Distributor

type Distributor interface {
	querier.Distributor
	UserStatsHandler(w http.ResponseWriter, r *http.Request)
}

type IndexPageContent

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

IndexPageContent is a map of sections to path -> description.

func (pc *IndexPageContent) AddLinks(weight int, groupDesc string, links []IndexPageLink)

func (*IndexPageContent) GetContent

func (pc *IndexPageContent) GetContent() []IndexPageLinkGroup
type IndexPageLink struct {
	Desc      string
	Path      string
	Dangerous bool
}

type IndexPageLinkGroup

type IndexPageLinkGroup struct {
	Desc  string
	Links []IndexPageLink
	// contains filtered or unexported fields
}

type Ingester

type Ingester interface {
	client.IngesterServer
	FlushHandler(http.ResponseWriter, *http.Request)
	ShutdownHandler(http.ResponseWriter, *http.Request)
	PrepareShutdownHandler(http.ResponseWriter, *http.Request)
	PreparePartitionDownscaleHandler(http.ResponseWriter, *http.Request)
	PrepareUnregisterHandler(w http.ResponseWriter, r *http.Request)
	UserRegistryHandler(http.ResponseWriter, *http.Request)
	TenantsHandler(http.ResponseWriter, *http.Request)
	TenantTSDBHandler(http.ResponseWriter, *http.Request)
	PrepareInstanceRingDownscaleHandler(http.ResponseWriter, *http.Request)
}

Ingester is defined as an interface to allow for alternative implementations of ingesters to be passed into the API.RegisterIngester() method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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