Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPartialScrapeError

func IsPartialScrapeError(err error) bool

IsPartialScrapeError checks if an error was wrapped with PartialScrapeError.

func NewPartialScrapeError

func NewPartialScrapeError(err error, failed int) error

NewPartialScrapeError creates PartialScrapeError for failed metrics. Use this error type only when a subset of data was failed to be scraped.

Types

type PartialScrapeError

type PartialScrapeError struct {
	Failed int
	// contains filtered or unexported fields
}

PartialScrapeError can be used to signalize that a subset of metrics were 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) Add

func (s *ScrapeErrors) Add(err error)

Add adds a regular error.

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.