Documentation ¶
Index ¶
- func GetAllTargetsByJob(allocator allocation.Allocator, job string) map[string]collectorJSON
- func RemoveRegexFromRelabelAction(jsonConfig []byte) ([]byte, error)
- type Option
- type Server
- func (s *Server) JobHandler(c *gin.Context)
- func (s *Server) LivenessProbeHandler(c *gin.Context)
- func (s *Server) MarshalScrapeConfig(configs map[string]*promconfig.ScrapeConfig, marshalSecretValue bool) error
- func (s *Server) PrometheusMiddleware(c *gin.Context)
- func (s *Server) ReadinessProbeHandler(c *gin.Context)
- func (s *Server) ScrapeConfigsHandler(c *gin.Context)
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) ShutdownHTTPS(ctx context.Context) error
- func (s *Server) Start() error
- func (s *Server) StartHTTPS() error
- func (s *Server) TargetsHandler(c *gin.Context)
- func (s *Server) UpdateScrapeConfigResponse(configs map[string]*promconfig.ScrapeConfig) error
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
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 Server ¶
type Server struct { ScrapeConfigMarshalledSecretResponse []byte // contains filtered or unexported fields }
func (*Server) JobHandler ¶
func (*Server) LivenessProbeHandler ¶
func (*Server) MarshalScrapeConfig ¶ added in v0.100.0
func (s *Server) MarshalScrapeConfig(configs map[string]*promconfig.ScrapeConfig, marshalSecretValue bool) error
func (*Server) PrometheusMiddleware ¶
func (*Server) ReadinessProbeHandler ¶
func (*Server) ScrapeConfigsHandler ¶
ScrapeConfigsHandler returns the available scrape configuration discovered by the target allocator.
func (*Server) ShutdownHTTPS ¶ added in v0.100.0
func (*Server) StartHTTPS ¶ added in v0.100.0
func (*Server) TargetsHandler ¶
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.