Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
enhancement(fluent source): Add support for forwarding over unix socket #22212
base: master
Are you sure you want to change the base?
enhancement(fluent source): Add support for forwarding over unix socket #22212
Changes from all commits
6711d85
19f889e
0153e32
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Unlike the socket data source I used untagged, to avoid this being a breaking change requiring introducing a "mode" tag. As the fields
path
vsaddress
are unlikely to ever overlap, I think this is probably fineThere 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.
Any thoughts on this? cc @jszwedko
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.
I'd suggest we maintain compatibility while also moving towards the desired configuration schema. That is, we add
mode
but default it totcp
so that if users only specifyaddress
it continues to work. If users want to use a unix socket, they should specifymode = ...
and then alsopath
. I'd suggest we also call this modeunix_stream
to match recent changes to thesocket
sink.Ideally we'd go further and start to evolve the configuration into what is described in the configuration spec. This would mean configuration would look like:
But I can see an argument for not going that far just yet since it would make it inconsistent with the existing configuration for the
socket
source/sink. So I'd be happy to just seemode
added.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.
Thanks Jesse, I am happy with both recommendations i.e. I am OK with diverging from
socket
as long as an example is provided.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.
Perhaps you could advise on how to achieve this, I'm not aware of a way to add a serde tag attribute with a default - https://serde.rs/enum-representations.html#internally-tagged
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.
This might be the easiest way to do this way: https://github.com/vectordotdev/vector/blob/master/src/sources/socket/mod.rs#L20-L48
Which will look like:
Jesse shared this with me: serde-rs/serde#2231. I guess the ideal way will need some custom deserialization.
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.
That would force mode to be specified, as linked in the serde issue, and would therefore be a breaking change.
I could manually implement Serialize but this would likely be a fairly chunky piece of code...
Just let me know how you would like to proceed, I'm not sure atm what is being asked for
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.
I think ideally we'd make this change in a non-breaking fashion while implementing the config UX we want. That is, allow for:
to continue to work and default to
tcp
while we add themode
option so that:Also works.
To your point, I'm not seeing a way to default
mode
using an adjacently tagged enum in serde so I think the options are:mode
,address,
andpath
options. When initializing the component, checkmode
, defaulting totcp
, and then look for the appropriate secondary field (address
orpath
), raising an error if it isn't setI think path (2) would be best since it maintains compatibility and is only slightly hacky to implement. What do you think?
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.
I don't really understand what this does, I just matched the socket source
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.
Can you please share a link to the code you are referring to?
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.
https://github.com/vectordotdev/vector/blob/master/src/sources/socket/mod.rs#L309
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.
This basically determines if this source supports acknowledgments. This is currently
true
. And it can stay astrue
if the new mode also supports acks.https://vector.dev/docs/about/under-the-hood/architecture/end-to-end-acknowledgements/
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.
I don't think the new mode does, it behaves similarly to the socket source which also does not