[receiver/awslambda] Adopt streaming for AWS Lambda receiver#46608
Conversation
75b0c51 to
fc28403
Compare
MichaelKatsoulis
left a comment
There was a problem hiding this comment.
Thank you @Kavindu-Dodan
Overall your approach looks very good. I just left some suggestions!
One minor concern I have is what if an encoding extension at the top level advertises LogsDecoderExtension but some of the formats (example of awslogs encoding extension) do not support streaming. In that case we will get an error that streaming not supported for format and not a backward compatibility with usage of legacy unmarshaler.
Any way maybe that could be handled best in the encoding extension itself and not in the receiver.
ef26253 to
66c6900
Compare
Thank you for the review 🤝 I think we cannot do much about sub-formats as they are internal 🤔 (If they expose the Decoder API contract but internally return error as implementation is missing, then those sub-formats will fail to work with the receiver) However, the adopter layer allows any extension that does not implement the Decoder API to work with receiver. |
|
@Kavindu-Dodan does it need to be DRAFT ? |
MichaelKatsoulis
left a comment
There was a problem hiding this comment.
Looks way better
a28f271 to
918a544
Compare
No we do not have to make this a draft. We can merge this if we get approvals |
918a544 to
a744ae5
Compare
#### Description Introduce adapters for plog.LogsUnmarshaler and pmetric.MetricsUnmarshaler which, on first call, read the entire stream into memory and invoke the unmarshaler. Subsequent calls return EOF. The offset is always the entire stream size in bytes, and if an offset is provided then that many bytes will discarded first. We also extract LogsDecoderFactory and MetricsDecoderFactory interfaces from LogsDecoderExtension and MetricsDecoderExtension in the encoding package. This PR was built with the assistance of Cursor. #### Link to tracking issue Relates to #46608 #### Testing Tests updated #### Documentation N/A
a744ae5 to
d761fa1
Compare
d761fa1 to
790664e
Compare
#### Description Introduce adapters for plog.LogsUnmarshaler and pmetric.MetricsUnmarshaler which, on first call, read the entire stream into memory and invoke the unmarshaler. Subsequent calls return EOF. The offset is always the entire stream size in bytes, and if an offset is provided then that many bytes will discarded first. We also extract LogsDecoderFactory and MetricsDecoderFactory interfaces from LogsDecoderExtension and MetricsDecoderExtension in the encoding package. This PR was built with the assistance of Cursor. #### Link to tracking issue Relates to open-telemetry#46608 #### Testing Tests updated #### Documentation N/A
#### Description Introduce adapters for plog.LogsUnmarshaler and pmetric.MetricsUnmarshaler which, on first call, read the entire stream into memory and invoke the unmarshaler. Subsequent calls return EOF. The offset is always the entire stream size in bytes, and if an offset is provided then that many bytes will discarded first. We also extract LogsDecoderFactory and MetricsDecoderFactory interfaces from LogsDecoderExtension and MetricsDecoderExtension in the encoding package. This PR was built with the assistance of Cursor. #### Link to tracking issue Relates to open-telemetry#46608 #### Testing Tests updated #### Documentation N/A
38734f7 to
6d8c26c
Compare
axw
left a comment
There was a problem hiding this comment.
Thanks @Kavindu-Dodan, just one last thing and I think it's good to go.
6d8c26c to
1987919
Compare
|
Please resolve conflicts |
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # receiver/awslambdareceiver/go.mod # receiver/awslambdareceiver/go.sum # Conflicts: # receiver/awslambdareceiver/go.mod # receiver/awslambdareceiver/go.sum # Conflicts: # receiver/awslambdareceiver/go.sum # Conflicts: # receiver/awslambdareceiver/go.mod # receiver/awslambdareceiver/go.sum # Conflicts: # receiver/awslambdareceiver/go.mod # receiver/awslambdareceiver/go.sum # Conflicts: # receiver/awslambdareceiver/go.mod # receiver/awslambdareceiver/go.sum
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
0aa1a17 to
e4fb78c
Compare
@atoulme thank you, all validations are green with the latest rebase 🙏 Could you please go ahead and merge this PR ? |
Description
This PR adopts streaming support introduced by AWS encoding extensions (refer #46214 )
This PR adopt streaming by,
xstreamencodinghelpers to adopt streaming support for non-streaming extensionsAbove approach allows to use the receiver with a streaming or non-streaming encoding extension.
Testing
Unit tests to validate API contracts changed/added by this PR
Documentation
Updated documents to highlight streaming encoding support