-
Notifications
You must be signed in to change notification settings - Fork 74
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
Allow expressions as file_desc and message_type args #900
base: main
Are you sure you want to change the base?
Conversation
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 for this contribution @nb-mouse . The reason these parameters are currently required to be static is so that they can just be loaded once at start-up and reused. This change will require the files to be reloaded on each and every event flowing through VRL and are Vector is likely to incur a large performance overhead because of that. If we implemented #137 that could enable something like this while maintaining performance. https://github.com/vectordotdev/vrl/blob/main/DESIGN.md discusses this and other VRL design decisions.
Could you share a bit your use case for using a dynamic proto definition? Would it be possible to have multiple remap
transforms where you split the input by type beforehand? Or is the complete list of types not known apriori?
Alternatively, and just speculating, maybe we could relax the static constraints on functions with some sort of opt-in flag for users know are willing to make the trade-off. This would need some more discussion before implementation though.
@jszwedko, this was a first attempt to handle events with Here is very early draft demonstrating an approach that works with several levels of |
It comes out that we can combine several desc files into one. So, we can use one desc file defined in source config and recursively attempt to load a desc from it when parsing For this particular PR we indeed might introduce an option either to load descriptor at compile time or dynamically. But I don't know how to implement that. Any other functions implements something similar? |
Perhaps, as additional feature we can add an option for the source config for protobuf to specify a directory with desc files and merge them on the Vector startup. |
Instead of extra parameters we might introduce separate proto_parse function. To simplify the logic and explicitly distinct functionality. |
Hopefully, this should fit better: #901 The changes above affects only source decoder. Perhaps, we can pass an extra config option to enable/disable this lookup feature. |
Thanks for the other PR! We'll take a look at that one. |
Hello, I came across this while looking at open VRL PRs. I think this idea is good. Also, it would benefit greatly from #137. |
This might be handy to dynamically load a protobuf description files and specifying message type based on payload being transformed.
This implementation allows to pass expressions instead of literal-only (constant) arguments.
Use case:
PS. I have a follow-up for recursive handling Any messages when processing source configuration.