-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allowing Remap to manipulate Metric values #5521
Comments
Yeah this is a good question. I think we should wait and see if we get demand for this. |
Would address #5521 and #8105 This intially just adds support for accessing and modifying counter and gauge values. Adding support for accessing and modifying distributions, aggregated histograms, and aggregated summaries would be trickier, but doable if we just allow accessing the components of each of these (for example the raw array of samples for distributions, the buckets for histograms). I wanted to get feedback on the general approach before continuing though. To answer some of the questions on the original issue: > We need to decide what to do if you, for example access .gauge.value when the metric is a counter? Is this an Error, or should it just return Null, or 0? I think we just return null. This is perhaps not idea, but consistent with how we handle other undefined fields on metrics. > Should we only provide read only access to these values, or should we allow modification? This is a good question. We could punt on allowing modification until someone asks for it. I'm not aware of any current use cases for modifying metric values. > Should we allow the script to change the metric type? So the script could take a Gauge in could output a Distribution? If this is possible, we may then want to allow data to persist over calls. So 10 Gauge inputs could result in a single Distribution being output? I think this would be better handled by metric aggregation capabilities via the `aggregate` and possibly future transforms. > Will this ever be something we want to do? I think yes. We've had a couple of people want to access the value for unit tests. Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
It would be great to get an update on this. |
@NasAmin you should be able to work around this with Lua as per #10171 (comment) |
Awesome thanks! Just wondering why the metrics type changes? I am assuming its the prometheus |
Yep, see #10171 (comment) and #10171 (comment). |
Just coming back to this, we have a sufficiently large instance of prometheus collecting 1000s of metrics. The metric names are not standardised. It will be impossible to detect or guess the metric type arriving from I am looking at Have I hit a wall or is there a better way? Thanks! |
👋 Will changing metric value and type be supported any time soon in VRL to avoid using Lua? |
No immediate plans unfortunately. It is in our backlog though. |
Any update here? I think the essential piece is providing some way at all to unit test values being output by vector. It'd be nice if that were handled in a unified way with remap, but probably not a strict requirement? |
Unfortunately no updates yet. This is a known gap 😦 |
Referencing the further work in RFC 3550 - 2020-11-01
As per the RFC ond #5475 Remap is being expanded to work with the metadata around a Metric. It could be useful if Remap could work with the actual Metric value as well.
The complication here is that there are several different metric types. We could provide access according to the type. So:
.counter.value
would return or set the value for counters..gauge.value
would return or set the value for gauges..distribution.values
would return or set an array for the distribution values.We need to decide what to do if you, for example access
.gauge.value
when the metric is a counter? Is this an Error, or should it just return Null, or 0?Should we only provide read only access to these values, or should we allow modification?
Should we allow the script to change the metric type? So the script could take a Gauge in could output a Distribution? If this is possible, we may then want to allow data to persist over calls. So 10 Gauge inputs could result in a single Distribution being output?
Will this ever be something we want to do?
The text was updated successfully, but these errors were encountered: