-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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] Container parser not playing well with downstream operator that experiences an error #34295
Comments
Pinging code owners for pkg/stanza: @djaglowski. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for receiver/filelog: @djaglowski. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Is the solution to remove that |
Yeap, I just verified that. After the first error the "failed" log is exported but then because of this This This makes me think of d31bc2e#diff-1818c0cdb6108c178ca89cf5ee768fba0a0de451e9b6431464429d6bf0d0a823R60 as well. @djaglowski do you think it's correct to return immediately if a downstream operator has failed 🤔 ? If the purpose of #33847 was to ensure that errors are logged (based on #33783), then we should only log and continue without returning. |
@ChrsMark I agree with your assessment. I think the loops were overlooked in both cases. |
I can prepare a patch for these and look around for any other place that might hit something similar. |
**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>
I observed the same behavior using the container parser followed by a JSON parser. The following log line makes the collector stop consuming logs after it fails to parse the logline as JSON.
Thanks a lot for reporting and fixing this! Would you happen to have a timeline for when it will be released (and available for usage)? |
Hey @gbxavier , based on the Release Schedule this should be available at |
@TylerHelmuth @djaglowski shall we close this one or we have anything else still pending? |
Resolved by #34342 |
Component(s)
pkg/stanza
What happened?
Description
I'm seeing strange behavior when I use the container parser chained with a regex parser that sometimes fails (because the regex is not always present in the log). When the
regex_parser
fails, logs collection stops. I believe this is because the container parser currently breaks out of thecrioConsumer
goroutine if theWrite
returns an error:opentelemetry-collector-contrib/pkg/stanza/operator/parser/container/parser.go
Lines 156 to 169 in d808572
Steps to Reproduce
Use a filelogreceiver config such as
Send through a log that does not match the regex parser and then send through a log that does match.
Expected Result
Both logs are sent, with the second having a severity set.
Actual Result
Neither logs are sent.
Collector version
v0.105.0
Environment information
No response
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: