Documentation
¶
Overview ¶
Package consumererror provides wrappers to easily classify errors. This allows appropriate action by error handlers without the need to know each individual error type/instance.
Index ¶
- func CombineErrors(errs []error) error
- func IsPartialScrapeError(err error) bool
- func IsPermanent(err error) bool
- func NewPartialScrapeError(err error, failed int) error
- func PartialLogsError(err error, failedLogs pdata.Logs) error
- func PartialMetricsError(err error, failedMetrics pdata.Metrics) error
- func PartialTracesError(err error, failed pdata.Traces) error
- func Permanent(err error) error
- type PartialError
- type PartialScrapeError
- type ScrapeErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineErrors ¶ added in v0.21.0
CombineErrors converts a list of errors into one error.
func IsPartialScrapeError ¶ added in v0.14.0
IsPartialScrapeError checks if an error was wrapped with PartialScrapeError.
func IsPermanent ¶
IsPermanent checks if an error was wrapped with the Permanent function, that is used to indicate that a given error will always be returned in the case that its sources receives the same input.
func NewPartialScrapeError ¶ added in v0.14.0
NewPartialScrapeError creates PartialScrapeError for failed metrics. Use this error type only when a subset of data was failed to be scraped.
func PartialLogsError ¶ added in v0.14.0
PartialLogsError creates PartialError for failed logs. Use this error type only when a subset of received data set failed to be processed or sent.
func PartialMetricsError ¶ added in v0.14.0
PartialMetricsError creates PartialError for failed metrics. Use this error type only when a subset of received data set failed to be processed or sent.
func PartialTracesError ¶ added in v0.6.0
PartialTracesError creates PartialError for failed traces. Use this error type only when a subset of received data set failed to be processed or sent.
Types ¶
type PartialError ¶ added in v0.6.0
type PartialError struct {
// contains filtered or unexported fields
}
PartialError can be used to signalize that a subset of received data failed to be processed or send. The preceding components in the pipeline can use this information for partial retries.
func (PartialError) GetLogs ¶ added in v0.14.0
func (err PartialError) GetLogs() pdata.Logs
GetLogs returns failed logs.
func (PartialError) GetMetrics ¶ added in v0.14.0
func (err PartialError) GetMetrics() pdata.Metrics
GetMetrics returns failed metrics.
func (PartialError) GetTraces ¶ added in v0.6.0
func (err PartialError) GetTraces() pdata.Traces
GetTraces returns failed traces.
type PartialScrapeError ¶ added in v0.14.0
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 ¶ added in v0.21.0
type ScrapeErrors struct {
// contains filtered or unexported fields
}
ScrapeErrors contains multiple PartialScrapeErrors and can also contain generic errors.
func (*ScrapeErrors) Add ¶ added in v0.21.0
func (s *ScrapeErrors) Add(err error)
Add adds a regular error.
func (*ScrapeErrors) AddPartial ¶ added in v0.21.0
func (s *ScrapeErrors) AddPartial(failed int, err error)
Add adds a PartialScrapeError with the provided failed count and error.
func (*ScrapeErrors) Combine ¶ added in v0.21.0
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.