Documentation
¶
Overview ¶
Package backend implements the backend TSDB server of load balancer app
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTypeAssertion = errors.New("failed type assertion")
)
Custom errors.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
ID string `yaml:"id"`
TSDBs []*ServerConfig `yaml:"tsdb"`
Pyros []*ServerConfig `yaml:"pyroscope"`
}
Backend defines backend server.
type Server ¶
type Server interface {
SetAlive(alive bool)
IsAlive() bool
URL() *url.URL
String() string
ActiveConnections() int
RetentionPeriod() time.Duration
ReverseProxy() *httputil.ReverseProxy
Serve(w http.ResponseWriter, r *http.Request)
}
Server is the interface each backend server (TSDB/Pyroscope) needs to implement.
func NewPyroscope ¶
func NewPyroscope(c *ServerConfig, logger *slog.Logger) (Server, error)
NewPyroscope returns an instance of backend Pyroscope server.
type ServerConfig ¶
type ServerConfig struct {
Web *models.WebConfig `yaml:"web"`
FilterLabels []string `yaml:"filter_labels"`
}
ServerConfig contains the configuration of backend server.
Click to show internal directories.
Click to hide internal directories.