Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Add multiline support to TCP #125

Merged
merged 11 commits into from
May 7, 2021
Merged

Add multiline support to TCP #125

merged 11 commits into from
May 7, 2021

Conversation

sumo-drosiek
Copy link
Member

This is my proposal for multiline support in TCP
It's not finished yet, but please see if this is acceptable direction

  • moving encoding and multiline to helper to reuse it in TCP
  • create reader for TCP input operator

Dominik Rosiek added 2 commits May 4, 2021 13:18
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
@sumo-drosiek
Copy link
Member Author

Sorry for the quality, but I want to get feedback of general idea quickly to resume work on that Tomorrow

@djaglowski
Copy link
Member

@sumo-drosiek, Thanks for taking a crack at this.

I agree with moving encoding and multiline to helper. I may have some minor comments later, but overall this looks great.

However, I don't see the value of the Reader. Can we just enhance goHandleMessages to make use of encoding and multiline? Maybe I am missing something, but this seems like an unnecessary abstraction.

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Thanks @sumo-drosiek!

operator/builtin/input/tcp/tcp.go Outdated Show resolved Hide resolved
operator/builtin/input/file/config.go Outdated Show resolved Hide resolved
@sumo-drosiek sumo-drosiek reopened this May 7, 2021
@sumo-drosiek
Copy link
Member Author

I change multiline to return splitFunc directly and renamed MaxBufferSize to MaxLogSize

@sumo-drosiek
Copy link
Member Author

ready to go 🎉

@djaglowski
Copy link
Member

@sumo-drosiek This looks great, but somehow the EasyCLA check is hung. I can't merge until is passes, and I don't see a way to retrigger it from my end. Will you please push a trivial commit in order to retrigger it?

@sumo-drosiek
Copy link
Member Author

@djaglowski I noticed that I use encoder only during splitting messages. I need to use it in decoding messages as well. Due to that encoder helper will be probably changed (extended with decode method)

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Comment on lines +59 to +60
decodeBuffer := make([]byte, 1<<12)
decoder := e.Encoding.NewDecoder()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I create it every call to avoid race conditions
I left file reader implementation in file operator because it's optimized for that usecase

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. If it proves to be a performance bottleneck at some point, we can look at optimizing then.

@sumo-drosiek
Copy link
Member Author

@djaglowski Please see latest commit and I think we are good to go :)

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

operator/helper/encoding.go Outdated Show resolved Hide resolved
Comment on lines +59 to +60
decodeBuffer := make([]byte, 1<<12)
decoder := e.Encoding.NewDecoder()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. If it proves to be a performance bottleneck at some point, we can look at optimizing then.

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
@sumo-drosiek sumo-drosiek changed the title [WIP] add multiline support to TCP Add multiline support to TCP May 7, 2021
@djaglowski djaglowski merged commit 83c0ef5 into open-telemetry:main May 7, 2021
@sumo-drosiek sumo-drosiek deleted the drosiek-multiline-helper branch May 7, 2021 14:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants