-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IsPermanent to account for wrapped errors #2455
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2455 +/- ##
==========================================
- Coverage 91.76% 91.76% -0.01%
==========================================
Files 266 266
Lines 15112 15111 -1
==========================================
- Hits 13867 13866 -1
Misses 867 867
Partials 378 378
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into this and was preparing a fix as well. The OTLP exporter potentially rewraps permanent errors, which end up getting retried, for example:
return md.MetricCount(), fmt.Errorf("failed to push metrics data via OTLP exporter: %w", err) |
Can confirm that this fixes that issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
@joe-elliott please fix the tests, I tried to re-run them multiple times and same error. Maybe a rebase would help. |
Signed-off-by: Joe Elliott <number101010@gmail.com>
Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
9e72f80
to
4cb6d71
Compare
Wow, yeah. I was way further behind than I realized. Rebased and pushed. |
Bumps [github.com/knadh/koanf](https://github.com/knadh/koanf) from 1.4.4 to 1.4.5. - [Release notes](https://github.com/knadh/koanf/releases) - [Commits](knadh/koanf@v1.4.4...v1.4.5) --- updated-dependencies: - dependency-name: github.com/knadh/koanf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description:
Currently IsPermanent does not correctly test for wrapped errors. We noticed this when the collector was incorrectly retrying otlp grpc FailedPrecondition status:
This occurs b/c the error is wrapped and the
IsPermanent
function test does not correctly detect wrapped errors.Error wrapping:
https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/otlp.go#L79
Go Playground with examples:
https://play.golang.org/p/kVBm3SesDBu
Testing:
Added a simple test to detect a wrapped error.