Is there a way to achieve that max clamping by passing an instant vector containing corresponding max values for each series?
In promQL, using the function clamp_max, it is possible to clamp the values of an instant vector with a scalar value, but if an instant vector is passed instead of the scalar, you get an error
Using function scalar() on that instant vector only works if the instant vector only contains one single value
The simplest solution for clamping
vtime series withmax_vseries is the following:This query works in the following way:
v < max_vleaves only values smaller thanmax_v.(...) or max_vfills gaps from the step 1 withmax_vvalues.