http

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckCollectorPipelineConfig

type CheckCollectorPipelineConfig struct {
	// Enabled indicates whether to not enable collector pipeline check.
	Enabled bool `mapstructure:"enabled"`
	// Interval the time range to check healthy status of collector pipeline
	Interval string `mapstructure:"interval"`
	// ExporterFailureThreshold is the threshold of exporter failure numbers during the Interval
	ExporterFailureThreshold int `mapstructure:"exporter_failure_threshold"`
}

CheckCollectorPipelineConfig is legacy config that is currently ignored as the `check_collector_pipeline` feature in the original healtcheck extension was not working as expected. This is here for backwards compatibility.

type Config

type Config struct {
	confighttp.ServerConfig `mapstructure:",squash"`

	Config PathConfig `mapstructure:"config"`
	Status PathConfig `mapstructure:"status"`
}

Config contains the v2 config for the http healthcheck service

type LegacyConfig

type LegacyConfig struct {
	confighttp.ServerConfig `mapstructure:",squash"`

	// Path represents the path the health check service will serve.
	// The default path is "/".
	Path string `mapstructure:"path"`

	// ResponseBody represents the body of the response returned by the health check service.
	// This overrides the default response that it would return.
	ResponseBody *ResponseBodyConfig `mapstructure:"response_body"`

	// CheckCollectorPipeline contains the config for collector pipeline health checks. It is
	// retained for backwards compatibility, but is otherwise ignored.
	CheckCollectorPipeline *CheckCollectorPipelineConfig `mapstructure:"check_collector_pipeline"`

	// UseV2 is an explicit opt-in to v2 behavior. When true, LegacyConfig will be ignored.
	UseV2 bool `mapstructure:"use_v2"`
}

LegacyConfig contains the config for the original healthcheck extension. We plan to migrate incrementally towards the v2 config and behavior. LegacyConfig is intentionally handled separately here and elsewhere to facilitate its eventual removal.

type PathConfig

type PathConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	Path    string `mapstructure:"path"`
}

type ResponseBodyConfig

type ResponseBodyConfig struct {
	// Healthy represents the body of the response returned when the collector is healthy.
	// The default value is ""
	Healthy string `mapstructure:"healthy"`

	// Unhealthy represents the body of the response returned when the collector is unhealthy.
	// The default value is ""
	Unhealthy string `mapstructure:"unhealthy"`
}

ResponseBodyConfig is legacy config that is currently supported, but can eventually be deprecated and removed.

type SerializableEvent added in v0.105.0

type SerializableEvent struct {
	Healthy      bool      `json:"healthy"`
	StatusString string    `json:"status"`
	Error        string    `json:"error,omitempty"`
	Timestamp    time.Time `json:"status_time"`
}

SerializableEvent is exported for json.Unmarshal

func (*SerializableEvent) Status added in v0.105.0

type Server added in v0.105.0

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

func NewServer added in v0.105.0

func NewServer(
	config *Config,
	legacyConfig LegacyConfig,
	componentHealthConfig *common.ComponentHealthConfig,
	telemetry component.TelemetrySettings,
	aggregator *status.Aggregator,
) *Server

func (*Server) NotifyConfig added in v0.105.0

func (s *Server) NotifyConfig(_ context.Context, conf *confmap.Conf) error

NotifyConfig implements the extension.ConfigWatcher interface.

func (*Server) Shutdown added in v0.105.0

func (s *Server) Shutdown(context.Context) error

Shutdown implements the component.Component interface.

func (*Server) Start added in v0.105.0

func (s *Server) Start(ctx context.Context, host component.Host) error

Start implements the component.Component interface.

Jump to

Keyboard shortcuts

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