server

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 67 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithMaxNodes added in v0.34.0

func ContextWithMaxNodes(parent context.Context, val int) context.Context

func MaxNodesFromContext added in v0.34.0

func MaxNodesFromContext(ctx context.Context) (int, bool)

func NewExportHandler added in v0.14.0

func NewExportHandler(httpUtils httputils.Utils) http.HandlerFunc

func NewIndexHandler added in v0.14.0

func NewIndexHandler(
	log *logrus.Logger,
	dir http.FileSystem,
	stats StatsReceiver,
	notifier Notifier,
	cfg *IndexHandlerConfig,
	httpUtils httputils.Utils,
) http.Handler

func NewIngestHandler added in v0.3.0

func NewIngestHandler(log *logrus.Logger, p ingestion.Ingester, onSuccess func(*ingestion.IngestInput), httpUtils httputils.Utils) http.Handler

func NewLabelValuesHandler added in v0.14.0

func NewLabelValuesHandler(s storage.LabelValuesGetter, httpUtils httputils.Utils) http.HandlerFunc

func NewLabelsHandler added in v0.14.0

func NewLabelsHandler(s storage.LabelsGetter, httpUtils httputils.Utils) http.HandlerFunc

Types

type Config added in v0.2.1

type Config struct {
	Configuration *config.Server
	Logger        *logrus.Logger
	// TODO(kolesnikovae): Ideally, Storage should be decomposed.
	*storage.Storage
	ingestion.Ingester
	*gorm.DB
	Notifier

	// The registerer is used for exposing server metrics.
	MetricsRegisterer       prometheus.Registerer
	ExportedMetricsRegistry *prometheus.Registry
	ScrapeManager           *scrape.Manager
	HistoryMgr              history.Manager
}

type Controller

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

func New

func New(c Config) (*Controller, error)

func (*Controller) AppsCount added in v0.0.13

func (ctrl *Controller) AppsCount() int

func (*Controller) Drain added in v0.0.34

func (ctrl *Controller) Drain()

func (*Controller) Start

func (ctrl *Controller) Start() error

func (*Controller) Stats added in v0.0.13

func (ctrl *Controller) Stats() map[string]int

func (*Controller) StatsInc added in v0.14.0

func (ctrl *Controller) StatsInc(name string)

func (*Controller) Stop added in v0.0.30

func (ctrl *Controller) Stop() error

type ExemplarsHandler added in v0.28.0

type ExemplarsHandler struct {
	StatsReceiver  StatsReceiver
	HistoryManager history.Manager
	HTTPUtils      httputils.Utils

	MaxNodesDefault int

	ExemplarsGetter  storage.ExemplarsGetter
	ExemplarsMerger  storage.ExemplarsMerger
	ExemplarsQuerier storage.ExemplarsQuerier
	HeatmapBuilder   HeatmapBuilder
}

func (ExemplarsHandler) MergeExemplars added in v0.28.0

func (h ExemplarsHandler) MergeExemplars(w http.ResponseWriter, r *http.Request)

func (ExemplarsHandler) QueryExemplars added in v0.28.0

func (h ExemplarsHandler) QueryExemplars(w http.ResponseWriter, r *http.Request)

type Flags added in v0.14.0

type Flags struct {
	EnableAdhocUI                   bool `json:"enableAdhocUI"`
	GoogleEnabled                   bool `json:"googleEnabled"`
	GitlabEnabled                   bool `json:"gitlabEnabled"`
	GithubEnabled                   bool `json:"githubEnabled"`
	InternalAuthEnabled             bool `json:"internalAuthEnabled"`
	SignupEnabled                   bool `json:"signupEnabled"`
	ExportToFlamegraphDotComEnabled bool `json:"exportToFlamegraphDotComEnabled"`
	IsAuthRequired                  bool `json:"isAuthRequired"`
	ExemplarsPageEnabled            bool `json:"exemplarsPageEnabled"`
}

type HeatmapBuilder added in v0.28.0

type HeatmapBuilder interface {
	BuildFromSketch(heatmap.HeatmapSketch) *heatmap.Heatmap
}

type HistoryHandler added in v0.28.0

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

func NewHistoryHandler added in v0.28.0

func NewHistoryHandler(
	l *logrus.Logger,
	httpUtils httputils.Utils,
	historyMgr history.Manager,
) *HistoryHandler

func (*HistoryHandler) ServeHTTP added in v0.28.0

func (rh *HistoryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type IndexHandler added in v0.14.0

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

func (*IndexHandler) ServeHTTP added in v0.14.0

func (ih *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type IndexHandlerConfig added in v0.14.0

type IndexHandlerConfig struct {
	Flags   Flags
	BaseURL string
}

type NoopHeatmapBuilder added in v0.28.0

type NoopHeatmapBuilder struct{}

func (NoopHeatmapBuilder) BuildFromSketch added in v0.28.0

type Notifier added in v0.2.2

type Notifier interface {
	// NotificationText returns message that will be displayed to user
	// on index page load. The message should point user to a critical problem.
	// TODO(kolesnikovae): we should poll for notifications (or subscribe).
	NotificationText() string
}

type Payload added in v0.9.0

type Payload struct {
	Name    string
	Profile string
	Type    string
}

type RemoteReadHandler added in v0.22.0

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

func NewRemoteReadHandler added in v0.22.0

func NewRemoteReadHandler(r config.RemoteRead) (*RemoteReadHandler, error)

func (*RemoteReadHandler) ServeHTTP added in v0.22.0

func (rh *RemoteReadHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RenderDiffHandler added in v0.14.0

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

func NewRenderDiffHandler added in v0.14.0

func NewRenderDiffHandler(
	l *logrus.Logger,
	s storage.Getter,
	dir http.FileSystem,
	stats StatsReceiver,
	maxNodesDefault int,
	httpUtils httputils.Utils,
	historyMgr history.Manager,
) *RenderDiffHandler

func (*RenderDiffHandler) ServeHTTP added in v0.14.0

func (rh *RenderDiffHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RenderDiffParams added in v0.0.38

type RenderDiffParams struct {
	LeftQuery string `json:"leftQuery"`
	LeftFrom  string `json:"leftFrom"`
	LeftUntil string `json:"leftUntil"`

	RightQuery string `json:"rightQuery"`
	RightFrom  string `json:"rightFrom"`
	RightUntil string `json:"rightUntil"`

	Format   string `json:"format"`
	MaxNodes *int   `json:"maxNodes,omitempty"`
}

RenderDiffParams refers to the params accepted by the renderDiffHandler

type RenderDiffResponse added in v0.14.0

type RenderDiffResponse struct {
	*flamebearer.FlamebearerProfile
	Metadata renderMetadataResponse `json:"metadata"`
}

RenderDiffResponse refers to the response of the renderDiffHandler

type RenderHandler added in v0.14.0

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

func NewRenderHandler added in v0.14.0

func NewRenderHandler(
	l *logrus.Logger,
	s storage.Getter,
	dir http.FileSystem,
	stats StatsReceiver,
	maxNodesDefault int,
	httpUtils httputils.Utils,
	historyMgr history.Manager,
	annotationsService api.AnnotationsService,
) *RenderHandler

func (*RenderHandler) ServeHTTP added in v0.14.0

func (rh *RenderHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type StatsReceiver added in v0.14.0

type StatsReceiver interface {
	StatsInc(name string)
}

type TargetsResponse added in v0.11.0

type TargetsResponse struct {
	Job                string              `json:"job"`
	TargetURL          string              `json:"url"`
	DiscoveredLabels   labels.Labels       `json:"discoveredLabels"`
	Labels             labels.Labels       `json:"labels"`
	Health             scrape.TargetHealth `json:"health"`
	LastScrape         time.Time           `json:"lastScrape"`
	LastError          string              `json:"lastError"`
	LastScrapeDuration string              `json:"lastScrapeDuration"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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