-
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
Please make it easy to do simple string interpolation using the OTTL library to facilitate developing other components #34700
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@michaelsafyan as with #34695 I am missing context here. Does the
All general OTTL functions live in
How an OTTL context interprets a path is up to that specific context. It is not exposed because contexts are not made to be extendable, they are made to represent a very specific OTLP telemetry structure, based closely on pdata/the otlp proto.
I am not sure what you mean here. I agree that the public API for parsing "statements" is not as friendly as the filter/select use case wrapped in |
No. To clarify, the logic of the component is like this:
In terms of the above pseudo-code, I think that the most logical way to represent
Yes, except that building the list of registered functions exists in ... it would appear that adding
I'm not suggesting that we be able to extend this logic outside the specific context. I am suggesting that this path resolution logic be consumable without higher-level abstractions above it. The ability to resolve a path to a value is, itself, a useful piece of logic that would be useful to be able to access without additional logic around it.
Read-only resolution of path expressions to values is what I'm getting at. Beyond this, being able to generate strings that interpolate these variables would be handy. And, beyond that, doing the above with some sort of defaulting mechanism (e.g. to handle attributes that are unset) would be handy. |
Curious to hear any thoughts/updates? |
I've managed to implement this here: ... as part of the end-to-end prototyping I was doing for #33737 . See:
I will be sending a PR soon to upstream just this piece of the prototype. |
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. |
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
I'm working on a component in which it is necessary to interpolate signal information into a string to construct a URI representing a destination for upload. This is the
Blob Attribute Uploader Connector
#33737 .What I'm trying to do is to be able to something like:
I think OTTL already has a lot of this logic existing within the notion of "OTTL contexts", but it is somewhat difficult to reuse this logic for a few reasons:
transformprocessor
rather than in thepkg/ottl
It's also a bit hard to work with the templating here (it's not obvious where
K
represents the signal type or whereK
represents the result type that the function is intended to produce).In my in-progress work on
blobattributeuploadconnector
, I've implemented theinterpolateSpanEvent
andinterpolateSpan
functions with a bit of hackery in OTTL:Parser.InterpolateString
But I suspect someone more familiar with OTTL can implement this more cleanly.
Describe the solution you'd like
Given the necessary inputs to construct an OTTL
TransformContext
, it would be ideal if it were simple to interpolate a string using that context.It would be convenient if the code could look like:
However, I'm open to other interfaces (as long as it is relatively simple to do).
Describe alternatives you've considered
Initially, I tried to build something like this from scratch and quickly realized that I was likely reinventing the wheel. OTTL looked promising as a way to share ideas around how to refer to the properties of the input signal.
I think extending/modifying the existing OTTL library is the correct approach. The alternative would be for me to attempt to do it myself, but I am likely to get this wrong.
Additional context
No response
The text was updated successfully, but these errors were encountered: