fix: cloudwatch control message makes consumelogs crash with sigsegv#44231
fix: cloudwatch control message makes consumelogs crash with sigsegv#44231ChrsMark merged 8 commits intoopen-telemetry:mainfrom
Conversation
Signed-off-by: Jean-Yves NOLEN <jynolen@gmail.com>
|
/tag bug |
constanca-m
left a comment
There was a problem hiding this comment.
I am not convinced this is something we should change in the encoding extension. If there is an error, we shouldn't initialize any logs. This looks like a bug on the receiver that is throwing that error
|
I kind disagree. I agree that in the caller responsability to check if return object is nil or not. |
|
I agree with both of you to some degree :) The stacktrace in the description is related to the control message: we're returning an uninitialised/zero-value Logs with no error. We should return an initialised, empty value to avoid the panic. It is standard practice in Go programs to ignore all other function results when a non-nil error is returned. The S3 receiver already ignores the results in error cases, so there's no need to change those. |
...on/encoding/awslogsencodingextension/internal/unmarshaler/subscription-filter/unmarshaler.go
Outdated
Show resolved
Hide resolved
...on/encoding/awslogsencodingextension/internal/unmarshaler/subscription-filter/unmarshaler.go
Outdated
Show resolved
Hide resolved
...on/encoding/awslogsencodingextension/internal/unmarshaler/subscription-filter/unmarshaler.go
Show resolved
Hide resolved
|
Will do the change. Another thing I found. Cloudwatch => Firehose => S3 produced inline concat json messages like I can add piece of code to handle those kind of format. |
|
@jynolen thanks. For the concatenated JSON: can you please open a new issue? I would rather we handle that in a separate PR too. I thought we had some code to handle that, but I may be thinking of the CloudWatch Metrics encoding: |
|
Change has been done and test added as required |
If got time will try to have a look to implement b4 next release |
|
@jynolen sorry I didn't notice earlier: can you please add a changelog entry? |
…pentelemetry-collector-contrib into fix/sigsegv-awsformatter
|
@constanca-m mind taking a look too, as 2nd code-owner of the component? |
|
Thank you for your contribution @jynolen! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help. |
Description
With following config:
And this kind of message in the bucket (gzip in bucket btw)
I got the following issue
Changing to proper logs initialization fix the issue