Documentation ¶
Overview ¶
Package scrapererror provides custom error types for scrapers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPartialScrapeError ¶
IsPartialScrapeError checks if an error was wrapped with PartialScrapeError.
Types ¶
type PartialScrapeError ¶
type PartialScrapeError struct { Failed int // contains filtered or unexported fields }
PartialScrapeError is an error to represent that a subset of metrics were failed to be scraped.
func NewPartialScrapeError ¶
func NewPartialScrapeError(err error, failed int) PartialScrapeError
NewPartialScrapeError creates PartialScrapeError for failed metrics. Use this error type only when a subset of data was failed to be scraped.
type ScrapeErrors ¶
type ScrapeErrors struct {
// contains filtered or unexported fields
}
ScrapeErrors contains multiple PartialScrapeErrors and can also contain generic errors.
func (*ScrapeErrors) AddPartial ¶
func (s *ScrapeErrors) AddPartial(failed int, err error)
AddPartial adds a PartialScrapeError with the provided failed count and error.
func (*ScrapeErrors) Combine ¶
func (s *ScrapeErrors) Combine() error
Combine converts a slice of errors into one error. It will return a PartialScrapeError if at least one error in the slice is a PartialScrapeError.