-
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 the capability to scale a metric value #16214
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
A solution for this may have some overlap with #16067 |
@gabrielgiussi yes the transform processor should be able to handle this. I think we can make a generic function that takes a float or int and scales it based on a factor. Instead of Function signature could look like
|
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. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
@gabrielgiussi OTTL supports arithmetic operations which should handle this use-case:
I do think there is a limitation with scaling histograms. |
If this ticket is available, I would like to work on this @evan-bradley FYI |
@TylerHelmuth @evan-bradley just a quick question for clarification - Since arithmetic operations can be used for achieving this, as suggested here, is the goal now to either:
|
@bacherfl thanks for looking at this. I am open to opinions on whether we just need histogram support or a new function. I believe a new function would provide the most consistent workflow for end users, and it could also optionally allow updating the metric unit. |
I would also agree we should implement a function. I would be in favor or either a A |
Operating on all the datapoints of a metric is the most similar to the metricstransformprocessor |
Thanks for your replies @TylerHelmuth @evan-bradley - I implemented this as a new converter function now - feel free to check out the linked PR :) |
**Description:** Adds a `Scale` function to the OTTL package. This function can be applied to `int`/`double` values, as well as metrics of the following types: - Sum - Gauge - Histogram **Link to tracking Issue:** #16214 **Testing:** Added Unit and E2E tests in the OTTL package. Tested manually in a sample environment with the following example configuration: ``` receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 processors: transform: error_mode: ignore metric_statements: - context: metric statements: - set(data_points, Scale(data_points, 10.0)) exporters: debug: verbosity: detailed otlphttp: endpoint: "######" headers: Authorization: "#####" service: pipelines: metrics: receivers: [otlp] exporters: [otlphttp, debug] processors: [transform] ``` **Documentation:** Added documentation in the `README` describing all functions in the `ottl` package --------- Signed-off-by: Florian Bacher <[email protected]> Co-authored-by: Evan Bradley <[email protected]> Co-authored-by: Tyler Helmuth <[email protected]>
Component(s)
processor/transform
Is your feature request related to a problem? Please describe.
Currently the metricstransformer already supports scaling a value and a recent PR even extended this for histograms.
Since processor/transformer will eventually replace metricstransformer could we add this feature?
If you agree with feature request I could work on this.
Describe the solution you'd like
Scale a value down/up, even histograms, e.g. to transform a histogram in milliseconds to seconds
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: