-
Notifications
You must be signed in to change notification settings - Fork 2.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
[pkg/stanza] handle errors from Operator.Process #33847
[pkg/stanza] handle errors from Operator.Process #33847
Conversation
seems some tests expect some errors to be ignored Test: opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/header/reader_test.go Line 75 in d78d7bb
Error that now shows:
|
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.
Generally looks good to me
here's what I tried - but I'm not sure this is the right path - and it's not working
if we can't figure this out, then maybe the approach is wrong |
01dcaf1
to
9e602e8
Compare
@zeitlinger, I pushed a minor change to the way the header parser processes errors. I think we just need the changelog now |
d5bbe60
to
cbff854
Compare
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> As discussed at #34295, error handling can be problematic in stanza package after the recent changes at #33847. Specifically: 1. When [`Write`](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/operator/helper/writer.go#L50) is called in a for loop, a returned error should not break the for loop. It should just be logged. 2. When [`Process`](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/d78d7bb37d0c84da04ac8a83356eb669ecd75a95/pkg/stanza/operator/operator.go#L40) is called in a for loop, a returned error should not break the for loop. It should just be logged. **Link to tracking Issue:** <Issue number if applicable> #34295 **Testing:** <Describe what testing was performed and which tests were added.> Added **Documentation:** <Describe the documentation added.> ~ --------- Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
…metry#35461) This PR contains some cleanup following open-telemetry#34720. This slightly changes some log messages. It also propagates errors encountered by sending to the next operator (which was done for other operators in open-telemetry#33847).
Link to tracking Issue: Fixes #33783
Testing:
nothing added
Documentation:
not applicable