Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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] Add support for scaling values #33246
[pkg/ottl] Add support for scaling values #33246
Changes from 12 commits
b782416
adcda48
4ebb38a
3ba07ac
d610bf0
9d741ac
d098a77
f019ec0
15a2006
213fcce
285a37d
fc1dc7f
4084b53
35064e1
343ce4e
549bdc3
fb04e21
75e24b1
49321a2
47d6834
313cd7e
d76e6cc
44997a1
0f07a49
92d33ed
f660ca6
37f16bb
62a539b
61e2a09
75a6d67
14bbdd8
0090fcc
d398d64
e495e03
c83e5ba
66c5bd5
bf746e7
ffed4f1
719daca
721c537
a6c39a1
876afc1
42d3140
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like @TylerHelmuth mentioned, could we add an optional parameter to adjust the unit? I think it would be nice for usability to do all scaling in one statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we make this an editor, an optional
unit
could be good here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small question regarding this: This requires a modification of both the
data_points
and theunit
property of a metric. Is there a way to access the complete metric via an OTTL statement? In the docs I only found a way to access either thedata_points
or theunit
:I guess a workaround would be to set the unit in a separate function, but if somehow possible I would like to also add the possibility to set the unit here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd have access to the metric in the TransformContext since this is a metrics-only function. So we could allow something like
scale_metric(10.0, unit="s")
.It can always be added later, so we could drop this idea until someone asks for it.