Repository navigation
Fix the Redis instance average command time staying near zero - #14258
Conversation
1ab795f to
6cc736f
Compare
|
Thanks @Tanishq-Choudhary, the diagnosis is right: the old rule took the rate of the lifetime average, not the average of the window. I pushed a fix-up to your branch, squashed into your commit (you stay the author), because the new rule alone still wouldn't give a useful panel. Why the rule needs a scale. OAP stores a MAL meter value as a whole number. The BanyanDB latency rules you modelled this on handle it the same way: they end in What changed in the push:
The Horizon UI panel title gets the unit in apache/skywalking-horizon-ui#226. If you have local work on this branch, save it before |
6cc736f to
e91f8cd
Compare
apache/skywalking#14258 fixes meter_redis_instance_average_time_spent_by_command, which showed 0 or 1 for every command, and reports it in microseconds. Title the Redis node dashboard's widget Avg Command Time (microseconds), in English and the seven translations, and give the unit in the Redis dashboard doc.
meter_redis_instance_average_time_spent_by_command divided the lifetime
counters redis_commands_duration_seconds_total and redis_commands_total
and then took rate('PT1M') of the ratio. That is how fast the lifetime
average drifts, not the average time of a command.
Divide the rate of the command time by the rate of the command count,
with safeDiv for commands idle in the window, and report the average in
microseconds. A meter value is stored as a whole number, and any value
between 0 and 1 is stored as 1, so an average in seconds, far below 1
for Redis, would show 1 for every command that ran.
The MAL script test input now spends 200 microseconds per command, so
the test pins the scale. The Redis monitoring doc gives the unit as
microseconds and names the instance metric.
e91f8cd to
f0eb580
Compare
|
Makes sense, thanks for the fix-up. |
…226) apache/skywalking#14258 fixes meter_redis_instance_average_time_spent_by_command, which showed 0 or 1 for every command, and reports it in microseconds. Title the Redis node dashboard's widget Avg Command Time (microseconds), in English and the seven translations, and give the unit in the Redis dashboard doc.
Fix the Redis instance
meter_redis_instance_average_time_spent_by_commandstaying near zeroThe instance rule divided the two lifetime counters from redis_exporter first and then took
rate('PT1M')of the ratio:That ratio is the lifetime average time per command. Its per-second rate is how fast that lifetime average drifts, which is close to 0 on any Redis that has been up for a while, and can go negative. The "Avg Command Time" panel of the Redis instance dashboard reads this metric, so it shows about 0 for every command.
The rule now takes the rate of each counter and divides them, the same shape the BanyanDB rules use for latency per call:
safeDivgives 0 for a command that did not run in the window, instead of NaN.The MAL script test expected 0.0 for this metric. Its input moves the duration and count counters by the same amount in 2 seconds (25/s each), so the average time per command is 1.0. The expectation is now 1.0; on master the test fails with
expected=1.0, actual=0.0.Values stored before the upgrade keep the old near-zero numbers, so the chart steps at the upgrade.
Update the
CHANGESlog.GraalVM distro impact:
instance_average_time_spent_by_commandexpression in otel-rules/redis/redis-instance.yaml; the distro compiles it as it is.