-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(outputs): Add framework to retry on startup errors (#14884)
- Loading branch information
Showing
6 changed files
with
405 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package internal | ||
|
||
import "errors" | ||
|
||
var ErrNotConnected = errors.New("not connected") | ||
|
||
// StartupError indicates an error that occurred during startup of a plugin | ||
// e.g. due to connectivity issues or resources being not yet available. | ||
// In case the 'Retry' flag is set, the startup of the plugin might be retried | ||
// depending on the configured startup-error-behavior. The 'RemovePlugin' | ||
// flag denotes if the agent should remove the plugin from further processing. | ||
type StartupError struct { | ||
Err error | ||
Retry bool | ||
Partial bool | ||
} | ||
|
||
func (e *StartupError) Error() string { | ||
return e.Err.Error() | ||
} | ||
|
||
func (e *StartupError) Unwrap() error { | ||
return e.Err | ||
} | ||
|
||
// FatalError indicates a not-recoverable error in the plugin. The corresponding | ||
// plugin should be remove by the agent stopping any further processing for that | ||
// plugin instance. | ||
type FatalError struct { | ||
Err error | ||
} | ||
|
||
func (e *FatalError) Error() string { | ||
return e.Err.Error() | ||
} | ||
|
||
func (e *FatalError) Unwrap() error { | ||
return e.Err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.