Documentation
¶
Index ¶
- func GetAllTargetsByCollectorAndJob(allocator allocation.Allocator, collectorName string, jobName string) []*targetJSON
- func GetAllTargetsByJob(allocator allocation.Allocator, job string) map[string]collectorJSON
- func RemoveRegexFromRelabelAction(jsonConfig []byte) ([]byte, error)
- func WriteHTMLBadRequest(w io.Writer, br BadRequestData)
- func WriteHTMLNotFound(w io.Writer, nf NotFoundData)
- func WriteHTMLPageFooter(w io.Writer)
- func WriteHTMLPageHeader(w io.Writer, hd HeaderData)
- func WriteHTMLPropertiesTable(w io.Writer, chd PropertiesTableData)
- type BadRequestData
- type Cell
- type HeaderData
- type NotFoundData
- type Option
- type PropertiesTableData
- type Server
- func (s *Server) CollectorHTMLHandler(c *gin.Context)
- func (s *Server) IndexHandler(c *gin.Context)
- func (s *Server) JobHTMLHandler(c *gin.Context)
- func (s *Server) JobsHTMLHandler(c *gin.Context)
- func (s *Server) JobsHandler(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) ScrapeConfigsHTMLHandler(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) TargetHTMLHandler(c *gin.Context)
- func (s *Server) TargetsHTMLHandler(c *gin.Context)
- 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 GetAllTargetsByCollectorAndJob ¶
func GetAllTargetsByCollectorAndJob(allocator allocation.Allocator, collectorName string, jobName string) []*targetJSON
GetAllTargetsByCollector returns all the targets for a given collector and job.
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 ¶
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
func WriteHTMLBadRequest ¶ added in v0.129.1
func WriteHTMLBadRequest(w io.Writer, br BadRequestData)
WriteHTMLBadRequest writes the bad request page.
func WriteHTMLNotFound ¶ added in v0.129.1
func WriteHTMLNotFound(w io.Writer, nf NotFoundData)
WriteHTMLNotFound writes the not found page.
func WriteHTMLPageFooter ¶ added in v0.129.1
WriteHTMLPageFooter writes the footer.
func WriteHTMLPageHeader ¶ added in v0.129.1
func WriteHTMLPageHeader(w io.Writer, hd HeaderData)
WriteHTMLPageHeader writes the header.
func WriteHTMLPropertiesTable ¶ added in v0.129.1
func WriteHTMLPropertiesTable(w io.Writer, chd PropertiesTableData)
WriteHTMLPropertiesTable writes the HTML for properties table.
Types ¶
type BadRequestData ¶ added in v0.129.1
BadRequestData contains data for the bad request template.
type Cell ¶ added in v0.129.1
type Cell struct {
// Link is the URL to link to. If empty, no link is created.
Link string
// Text is the text to display in the cell.
Text string
// Preformatted indicates if the text should be displayed as preformatted text.
Preformatted bool
}
Cell represents a cell in a row.
type HeaderData ¶ added in v0.129.1
type HeaderData struct {
Title string
}
HeaderData contains data for the header template.
type NotFoundData ¶ added in v0.129.1
BadRequestData contains data for the bad request template.
type PropertiesTableData ¶ added in v0.129.1
PropertiesTableData contains data for properties table template.
type Server ¶
type Server struct {
ScrapeConfigMarshalledSecretResponse []byte
// contains filtered or unexported fields
}
func (*Server) CollectorHTMLHandler ¶ added in v0.129.1
func (*Server) IndexHandler ¶ added in v0.129.1
IndexHandler displays the main page of the allocator. It shows the number of jobs and targets. It also displays a table with the collectors and the number of jobs and targets for each collector. The collector names are links to the respective pages. The table is sorted by collector name.
func (*Server) JobHTMLHandler ¶ added in v0.129.1
func (*Server) JobsHTMLHandler ¶ added in v0.129.1
JobsHTMLHandler displays the jobs in a table format. Each job is a row in the table. The table has two columns: Job and Target Count. The Job column is a link to the job's targets.
func (*Server) JobsHandler ¶ added in v0.129.1
func (*Server) LivenessProbeHandler ¶
func (*Server) MarshalScrapeConfig ¶
func (s *Server) MarshalScrapeConfig(configs map[string]*promconfig.ScrapeConfig, marshalSecretValue bool) error
func (*Server) PrometheusMiddleware ¶
func (*Server) ReadinessProbeHandler ¶
func (*Server) ScrapeConfigsHTMLHandler ¶ added in v0.129.1
func (*Server) ScrapeConfigsHandler ¶
ScrapeConfigsHandler returns the available scrape configuration discovered by the target allocator.
func (*Server) StartHTTPS ¶
func (*Server) TargetHTMLHandler ¶ added in v0.129.1
TargetHTMLHandler displays information about a target in a table format. There are two tables: one for high-level target information and another for the target's labels.
func (*Server) TargetsHTMLHandler ¶ added in v0.129.1
TargetsHTMLHandler displays the targets in a table format. Each target is a row in the table. The table has four columns: Job, Target, Collector, and Endpoint Slice. The Job, Target, and Collector columns are links to the respective pages.
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.