enhancement(lua transform): Implement all hooks and timers in version 2 #2126
enhancement(lua transform): Implement all hooks and timers in version 2 #212656 commits merged intomasterfrom
Conversation
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
hooks.process in version 2
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
| [docs.configuration#environment-variables]: /docs/setup/configuration/#environment-variables | ||
| [docs.data-model.log#schema]: /docs/about/data-model/log/#schema | ||
| [docs.data-model.log]: /docs/about/data-model/log/ | ||
| [docs.data-model.metric]: /docs/about/data-model/metric/ |
There was a problem hiding this comment.
The inconsistent naming here is unfortunate. :(
There was a problem hiding this comment.
I agree, it makes sense to use snake case everywhere.
src/transforms/lua/v2/mod.rs
Outdated
| result | ||
| } | ||
|
|
||
| // Used only in tests. |
There was a problem hiding this comment.
Can we #[cfg(test)] this?
There was a problem hiding this comment.
These are part of the Transform trait, so it is necessary to provide at least some implementation for them.
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
|
Now all three kinds of hooks, as well as timers, are implemented. I spent some time trying to put the runtime into a separate thread, because it is not robust to block Tokio thread. However, the current implementation runs on Tokio thread, so I think it is fine postpone moving the execution into a separate thread. I've created issue #2200 for this. I'm going to tidy up the documentation tomorrow, but for now it is possible to consult the RFC for the description. |
|
Sounds good! I can help with the docs as well. Why don't you make a first pass then I'll review. |
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
|
Edit: I've re-added this now that I understand it can be used as the single place for all Lua source. |
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
|
Ok, I've improved the configuration examples. As a side effect of doing this I fixed an option sorting bug that resulted in updating a number of other documentation pages. |
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
There's no issue with accepting both logs and metrics. The question is really about having A quick fix would be to add a config option to specify the output type and filter accordingly. |
|
@a-rodin if we can address that final issue then we should be able to merge. If I recall, the proper fix is more involved and will need to be resolved separately (#1998 (comment)). You're also welcome to take a stab at solving this properly. |
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
|
Actually I feel like solving it properly might be not much harder than adding by I'm less familiar with sinks though, so I'll take a look at them. |
|
Yeah, depending on what you find I wouldn't mind considering fixing this correctly. That was on Luke's plate but he has more pressing issues he's addressing this week. |
Signed-off-by: binarylogic <bjohnson@binarylogic.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
lukesteensen
left a comment
There was a problem hiding this comment.
Very clever! I should have thought of this myself 😄
Eventually, it would be nice to have this more isolated from topology building, skip filtering when we know it's not needed, etc. But this is very practical and should work quite well! 👏
| | (Node::Transform { out_ty: ty1, .. }, Node::Transform { in_ty: ty2, .. }) | ||
| | (Node::Transform { out_ty: ty1, .. }, Node::Sink { ty: ty2, .. }) => { | ||
| if ty1 != ty2 && ty2 != DataType::Any { | ||
| if ty1 != ty2 && ty1 != DataType::Any && ty2 != DataType::Any { |
There was a problem hiding this comment.
Did this not require any changes to the tests? I must have missed a case. Could be worth adding a quick one now.
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Closes #616, closes #1549, closes #2189.
Currently it implements only
processhook, I want to put other hooks to a separate PR because it would involve changing the streamThis is based on top of work from #2095. I'm going to also update the documentation and add some example before merging this.