Description
Component(s)
connector/routing
Is your feature request related to a problem? Please describe.
Today when reading a routingconnect config that uses OTTL statements or conditions, it is not immediately clear which OTTL context is being used. If a config contains the condition
attributes["env"] == "prod" and attributes["region"] == "east"
you have to know that the component uses ottlresource
context by default. This can be confusing for new users and is a failing of OTTL.
Describe the solution you'd like
We added a new feature to OTTL to allow parsers to infer the context based on the statement's paths, functions, and enums. This means that instead of writing:
attributes["env"] == "prod" and attributes["region"] == "east"
and not being sure whose attributes are being used, you'd write
resource.attributes["env"] == "prod" and resource.attributes["region"] == "east"
and now it is immediately clear that we're using the resource's attributes.
We've added this feature to the transformprocessor already. We'll need work from #37904 to get the infer context stuff working for OTTL Conditions.
Describe alternatives you've considered
No response
Additional context
When this work is done users will be able to safely copy and paste statements/conditions between transformprocessor, filterprocessor, and routingconnector.