-
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
[pkg/ottl] Provide Context at Metric Level instead of DataPoint Level #13838
Comments
@dmitryax I am curious if any of the metricstransform processor scenarios require individual datapoint interactions? |
Yes, things like attribute renaming, dropping datapoints that match attributes |
@dmitryax could those be handled by a "datapoint" context tho? Or are you saying that while interacting at the "metric" level we also need to be able to mess with individual data points? |
This is what's happening in metrics transform. We don't have concept of context there. |
I'll need to keep iterating on how to handle this then. If we need to be able to interact with an individual DataPoint at the same time (with in the same function/group of functions) that we interact with the metric/DataPointsSlice then we'll need to do some rearchitecting. |
@dmitryax @bogdandrutu looking through the metricstransformprocessor's current functionality, I think it can be broken down into these 2 separate OTTL Contexts
* use Metric if need to affect all DataPoints in a metric and use DataPoint if only want to change a subset of DataPoints. Reading through the readme I don't see any operations that both aggregate and interact with specific data points. For this reason I think it would be possible to transition all metricstransformprocessor functionality to a processor using OTTL if we provide both a Metric and DataPoint context. In the transformprocessor, we'll need a way to specify the order of operations between statements that using Metric and statements that use DataPoint, but that seems doable within the configuration file. |
Is your feature request related to a problem? Please describe.
The current tqlmetrics context is based on GetItem() returning a datapoint. This is useful for interacting with datapoints, but makes certain transformations, such as metrics aggregation impossible.
Describe the solution you'd like
A context at the metrics level that will have access to all the datapoints of a metric.
Additional context
The new context will, I think, struggle to create Getters for individual datapoint values. For example, for a condition like
... where data_points.attributes["test"] == "pass"
, how will the context provide a Getter that is the values of all the datapoints attribute named "test"?Setters will be ok, because the context can be smart enough to iterate through each data point, but it will not be conditional to the individual data point; it would be all or nothing.
Example implementation (for only Sum):
It is possible this limitation is acceptable; if you need to interact with individual data points then use the datapoint context. It might be inappropriate for the metrics context to provide access to anything lower than the DataPoints slice.
The text was updated successfully, but these errors were encountered: