Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PrefixForInvalidLabelName is a prefix string for mark invalid label name become valid PrefixForInvalidLabelName = model.ReservedLabelPrefix + "invalid_label_" // StateNormal indicates this target is scraping normally StateNormal = "" // StateInTransfer indicate this target is in transfer process StateInTransfer = "in_transfer" )
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 load of last 3 times scraping, metrics_relabel_configs will be process Series int64 `json:"series"` // TargetState indicate current state of this target TargetState string `json:"TargetState"` // ScrapeTimes is the times target scraped by this shard ScrapeTimes uint64 `json:"ScrapeTimes"` // 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) UpdateSeries ¶ added in v0.0.5
func (t *ScrapeStatus) UpdateSeries(load int64)
UpdateSeries 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"` // TargetState indicate current state of this target TargetState string `json:"TargetState"` }
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.