Version: v1.25.5 Latest Latest

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 56 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type AlertByStateCount added in v1.25.3

type AlertByStateCount struct {
	Inactive int32
	Pending  int32
	Firing   int32

type AlertStatus

type AlertStatus struct {
	Groups               []*rules.Group
	AlertStateToRowClass map[rules.AlertState]string
	Counts               AlertByStateCount

AlertStatus bundles alerting rules and the mapping of alert states to row classes.

type Handler

type Handler struct {
	// contains filtered or unexported fields

Handler serves various HTTP endpoints of the Prometheus server

func New

func New(logger log.Logger, o *Options) *Handler

New initializes a new web Handler.

func (*Handler) ApplyConfig

func (h *Handler) ApplyConfig(conf *config.Config) error

ApplyConfig updates the config field of the Handler struct

func (*Handler) Listener added in v1.25.3

func (h *Handler) Listener() (net.Listener, error)

Listener creates the TCP listener for web requests.

func (*Handler) Quit

func (h *Handler) Quit() <-chan struct{}

Quit returns the receive-only quit channel.

func (*Handler) Ready added in v1.8.0

func (h *Handler) Ready()

Ready sets Handler to be ready.

func (*Handler) Reload

func (h *Handler) Reload() <-chan chan error

Reload returns the receive-only channel that signals configuration reload requests.

func (*Handler) Run

func (h *Handler) Run(ctx context.Context, listener net.Listener, webConfig string) error

Run serves the HTTP endpoints.

type LocalStorage added in v1.25.3

type LocalStorage interface {

type Options

type Options struct {
	Context               context.Context
	TSDBRetentionDuration model.Duration
	TSDBDir               string
	TSDBMaxBytes          units.Base2Bytes
	LocalStorage          LocalStorage
	Storage               storage.Storage
	QueryEngine           *promql.Engine
	LookbackDelta         time.Duration
	ScrapeManager         *scrape.Manager
	RuleManager           *rules.Manager
	Notifier              *notifier.Manager
	Version               *PrometheusVersion
	Flags                 map[string]string

	ListenAddress              string
	CORSOrigin                 *regexp.Regexp
	ReadTimeout                time.Duration
	MaxConnections             int
	ExternalURL                *url.URL
	RoutePrefix                string
	UseLocalAssets             bool
	UserAssetsPath             string
	ConsoleTemplatesPath       string
	ConsoleLibrariesPath       string
	EnableLifecycle            bool
	EnableAdminAPI             bool
	PageTitle                  string
	RemoteReadSampleLimit      int
	RemoteReadConcurrencyLimit int
	RemoteReadBytesInFrame     int
	RemoteWriteReceiver        bool

	Gatherer   prometheus.Gatherer
	Registerer prometheus.Registerer

Options for the web Handler.

type PrometheusVersion

type PrometheusVersion = api_v1.PrometheusVersion

PrometheusVersion contains build information about Prometheus.

Source Files


Path Synopsis
Package ui provides the assets via a virtual filesystem.
Package ui provides the assets via a virtual filesystem.

Jump to

Keyboard shortcuts

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