Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PrefixForInvalidLabelName is a prefix string for mark invalid label name become valid PrefixForInvalidLabelName = model.ReservedLabelPrefix + "invalid_label_" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScrapeStatus ¶
type ScrapeStatus struct { // LastError save the error string if last scraping is error LastError string `json:"lastError"` // LastScrape save the time of last scraping LastScrape time.Time `json:"lastScrape"` // LastScrapeDuration save the seconds duration last scraping spend LastScrapeDuration float64 `json:"lastScrapeDuration"` // Health it the status of last scraping Health scrape.TargetHealth `json:"health"` // Series is the avg sample of last 3 times scraping, metrics_relabel_configs will be process Series int64 `json:"series"` // contains filtered or unexported fields }
ScrapeStatus contains last scraping status of the target
func NewScrapeStatus ¶
func NewScrapeStatus(series int64) *ScrapeStatus
NewScrapeStatus create a new ScrapeStatus with referential Series
func (*ScrapeStatus) SetScrapeErr ¶
func (t *ScrapeStatus) SetScrapeErr(start time.Time, err error)
SetScrapeErr mark the result of this scraping health will be down if err is not nil health will be up if err is nil
func (*ScrapeStatus) UpdateSamples ¶
func (t *ScrapeStatus) UpdateSamples(s int64)
UpdateSamples statistic target samples info
type Target ¶
type Target struct { // Hash is calculated from origin labels before relabel_configs process and the URL of this target // see prometheus scrape.Target.hash Hash uint64 `json:"hash"` // Labels is result of relabel_configs process Labels labels.Labels `json:"labels"` // Series is reference series of this target, may from target explorer Series int64 `json:"series"` }
Target is a target generate prometheus config
func (*Target) NoParamURL ¶
NoParamURL return a url without params
func (*Target) NoReservedLabel ¶
NoReservedLabel return the labels without reserved prefix "__"
Click to show internal directories.
Click to hide internal directories.