server

package
v0.108.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllTargetsByJob

func GetAllTargetsByJob(allocator allocation.Allocator, job string) map[string]collectorJSON

GetAllTargetsByJob is a relatively expensive call that is usually only used for debugging purposes.

func RemoveRegexFromRelabelAction added in v0.98.0

func RemoveRegexFromRelabelAction(jsonConfig []byte) ([]byte, error)

RemoveRegexFromRelabelAction is needed specifically for keepequal/dropequal actions because even though the user doesn't specify the regex field for these actions the unmarshalling implementations of prometheus adds back the default regex fields which in turn causes the receiver to error out since the unmarshaling of the json response doesn't expect anything in the regex fields for these actions. Adding this as a fix until the original issue with prometheus unmarshaling is fixed - https://github.com/prometheus/prometheus/issues/12534

Types

type Option added in v0.100.0

type Option func(*Server)

func WithTLSConfig added in v0.100.0

func WithTLSConfig(tlsConfig *tls.Config, httpsListenAddr string) Option

Option to create an additional https server with mTLS configuration. Used for getting the scrape config with real secret values.

type Server

type Server struct {
	ScrapeConfigMarshalledSecretResponse []byte
	// contains filtered or unexported fields
}

func NewServer

func NewServer(log logr.Logger, allocator allocation.Allocator, listenAddr string, options ...Option) *Server

func (*Server) JobHandler

func (s *Server) JobHandler(c *gin.Context)

func (*Server) LivenessProbeHandler

func (s *Server) LivenessProbeHandler(c *gin.Context)

func (*Server) MarshalScrapeConfig added in v0.100.0

func (s *Server) MarshalScrapeConfig(configs map[string]*promconfig.ScrapeConfig, marshalSecretValue bool) error

func (*Server) PrometheusMiddleware

func (s *Server) PrometheusMiddleware(c *gin.Context)

func (*Server) ReadinessProbeHandler

func (s *Server) ReadinessProbeHandler(c *gin.Context)

func (*Server) ScrapeConfigsHandler

func (s *Server) ScrapeConfigsHandler(c *gin.Context)

ScrapeConfigsHandler returns the available scrape configuration discovered by the target allocator.

func (*Server) Shutdown

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

func (*Server) ShutdownHTTPS added in v0.100.0

func (s *Server) ShutdownHTTPS(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

func (*Server) StartHTTPS added in v0.100.0

func (s *Server) StartHTTPS() error

func (*Server) TargetsHandler

func (s *Server) TargetsHandler(c *gin.Context)

func (*Server) UpdateScrapeConfigResponse

func (s *Server) UpdateScrapeConfigResponse(configs map[string]*promconfig.ScrapeConfig) error

UpdateScrapeConfigResponse updates the scrape config response. The target allocator first marshals these configurations such that the underlying prometheus marshaling is used. After that, the YAML is converted in to a JSON format for consumers to use.

Jump to

Keyboard shortcuts

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