web

package
v0.0.0-...-d0f20ad Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustBuildServerURL

func MustBuildServerURL(pathPrefix string) string

MustBuildServerURL returns the server URL and panics in case an error occurs.

Types

type AlertStatus

type AlertStatus struct {
	AlertingRules        []*rules.AlertingRule
	AlertStateToRowClass map[rules.AlertState]string
}

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

type AlertsHandler

type AlertsHandler struct {
	RuleManager *rules.Manager
	PathPrefix  string
	// contains filtered or unexported fields
}

AlertsHandler implements http.Handler.

func (*AlertsHandler) ServeHTTP

func (h *AlertsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ConsolesHandler

type ConsolesHandler struct {
	QueryEngine *promql.Engine
	PathPrefix  string
}

ConsolesHandler implements http.Handler.

func (*ConsolesHandler) ServeHTTP

func (h *ConsolesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GraphsHandler

type GraphsHandler struct {
	PathPrefix string
}

GraphsHandler implements http.Handler.

func (*GraphsHandler) ServeHTTP

func (h *GraphsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type PrometheusStatusHandler

type PrometheusStatusHandler struct {
	BuildInfo map[string]string
	Config    string
	Flags     map[string]string

	RuleManager *rules.Manager
	TargetPools func() map[string][]*retrieval.Target

	Birth      time.Time
	PathPrefix string
	// contains filtered or unexported fields
}

PrometheusStatusHandler implements http.Handler.

func (*PrometheusStatusHandler) ApplyConfig

func (h *PrometheusStatusHandler) ApplyConfig(conf *config.Config)

ApplyConfig updates the status handler's state as the new config requires.

func (*PrometheusStatusHandler) ServeHTTP

func (*PrometheusStatusHandler) TargetHealthToClass

func (h *PrometheusStatusHandler) TargetHealthToClass() map[retrieval.TargetHealth]string

TargetHealthToClass returns a map of TargetHealth to the name of a Bootstrap CSS class.

type WebService

type WebService struct {
	StatusHandler   *PrometheusStatusHandler
	MetricsHandler  *api.MetricsService
	AlertsHandler   *AlertsHandler
	ConsolesHandler *ConsolesHandler
	GraphsHandler   *GraphsHandler

	QuitChan chan struct{}
}

WebService handles the HTTP endpoints with the exception of /api.

func (WebService) ServeForever

func (ws WebService) ServeForever(pathPrefix string)

ServeForever serves the HTTP endpoints and only returns upon errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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