-
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] Set attribute values using connection context #33288
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hey @TylerHelmuth I would like to look at this issue |
@odubajDT @evan-bradley I'd like to talk about this more. We don't have syntax or a specific transformcontext to represent how to extract something from the connection context. I'd like to see some proposals on how we'd implement this before making a PR. |
Could we have that discussion on a draft PR? I would prefer to look at something concrete when considering possible designs. I think the high-level design is fairly straightforward (get a value from the context through a path/converter), and the implementation is what's under consideration. |
As an initial proposal, we'll want a As for the transform context, the most conventional way to do this would be to add If the implementation shows flaws, we can probably pull this off using a converter that relies on an interface implemented by the transform context, but I'd rather save this as a plan B. |
We keep breaking |
I think for now it's conceptually simpler for all data to be required. I think we will always have a In regards to breaking |
Ok lets try with just breaking it. Are there any security concerns here? It seems likely you could do something like |
I dug into it and there's no way to iterate over The one tricky thing is that any complex key/value types will be basically impossible to do without custom OTTL extensions. I'm not sure how we properly address this situation:
Keying this would be impossible with OTTL, and even if you use e.g. a string key here instead, using the data is impossible unless you can e.g. convert the type to a map. I think this will just have to be a known caveat. |
Requiring an index should be enforceable by the ottl context path function. I agree we should only support string keys. |
We don't have to enforce this, Thinking on it, users could add Converters to provide support for complex key types, e.g. |
In that case, I think we should be extremely strict about NOT adding any |
One additional question here, if I understand the implementation of attributes processor correctly, there is the possibility to extract context data only from the following context keys:
What in this case means connection context? Do we want to duplicate the exact same functionality or something else as well? Thanks in advance! |
The Collector passes a
I think the fact that we have the ability to spread operations over multiple statements means that we don't have to special-case this kind of addressing. For example, we could have the following: |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@djaglowski and I talked a bit about this at kubecon. We think we can get away with including the |
One additional detail which @TylerHelmuth and I discussed about how OTTL paths could refer to contexts: As mentioned elsewhere in the thread, context values can be added in several different ways and each way requires a different access pattern in code. I recently added support in the routing connector to route based on either grpc or http request context, so there is an example here where we fetch values from the context using two different mechanisms. At the same time, it shows how it may be useful to automatically check all known mechanisms for the value, since data may be received in various ways but then sent to the same component for processing. Based on these use cases, the idea we came up with that each known mechanism for accessing values in the context would have its own
|
Component(s)
processor/transform
Is your feature request related to a problem? Please describe.
The attribute and resource processors have a
from_context
config argument which can be used to set attribute values using connection context:It would be nice to be able to do the same thing with the transform processor.
Describe the solution you'd like
The solution should work with all OTTL contexts, so probably we need to add a new OTTL function?
Describe alternatives you've considered
No response
Additional context
This feature will help reduce the need for
attributes
andresource
processors.Also, #18643 suggests that the
transform
processor may replace theattributes
andresource
processors. Having this feature would be a prerequisite for that.The text was updated successfully, but these errors were encountered: