-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/transform] Add ability to concat strings #12476
Comments
@kentquirk what do you think? If we go anywhere near option 2 it needs to wait on #11751 lol |
In the long run, I'd prefer to actually give TQL a full expression parser that can do math and concatenations and basic language operations -- and probably also a few embedded functions in TQL for things like string processing and type conversion. But I don't think that a Concat factory in the transform processor gets in the way of that, so if it solves an immediate problem I would support the idea. |
Agreed. |
Updated Issue description. |
I can take this one. I think it may make sense to expand the scope a little bit. Would it make sense to:
I realize that this issue is supposed to be a stopgap until the TQL supports more string operations, so if a more powerful solution would be better suited for that effort, then I think simply concatenating two strings works. Additionally, I'm not sure if the parser can currently handle either of those cases, so keeping the factory simple may be necessary. |
Great idea. The grammar knows how to accept string arrays so this is just as straight forward as 2 strings.
I'm not following what you mean here. |
Using Go templates could look like the following:
The data provided to fill the template would just come from the signal fields. Looking at this now, I think just providing a list to the |
I agree. Especially because templating looks the same as building concat directly into the language: |
Agreed. Please assign this to me, I should be able to implement the factory relatively quickly. |
@evan-bradley, the factory function will probably need to accept Getters instead of strings, so that functions and paths can be used. I don't think the grammar supports arrays of getters yet, but it could be made to do so. That would be an update to |
… functions This is a prerequisite for open-telemetry#12476.
… functions This is a prerequisite for open-telemetry#12476.
… functions (#12706) This allows TQL functions to receive an array of Getters as a parameter. This is a prerequisite for #12476, which will need to concatenate strings and path references to strings and therefore requires the ability to receive an array containing more than one primitive type. Co-authored-by: Evan Bradley <[email protected]> Co-authored-by: Tyler Helmuth <[email protected]> Co-authored-by: Alex Boten <[email protected]>
Is your feature request related to a problem? Please describe.
There are situations where a user might need to combine existing fields to be used as an argument in an Invocation. Here is an example.. At the moment the TQL has no build-in capability to do this and the transform processor has not function that can do it.
Describe the solution you'd like
I think we have 2 options.
Add something to the TQL so it knows how to do this natively.We should do this, but in the future. For now, to enhance the transform processor, we'll use a Factory.I'm leaning towards option 1, as it is simpler to implement and factories are already a defined pattern.
The text was updated successfully, but these errors were encountered: