2

Help me with this otherwise very simple task... I have a series of metrics that represent a certain virtual machine state. I want to plot a graph with the count of all metrics that have been between a certain range (35-51). This is my query:

countSeries(filterSeries(filterSeries(opennebula-performance.zones.opennebula-innologica.vms.3DC.*.vm_lcm_state, 'min' , '>', 35 ), 'max', '<', 51))

This seems to be working well when there is at least one metric in the range. However when there are none (and it's the common case since there aren't usually faulty VMs), Graphite returns just [] instead of series with zeroes. Grafana doesn't like this and plots no data.

Why doesn't countSeries return 0 when there are no matches? This will indeed plot a straight line at 0 for the whole period, but this is exactly what is needed here.

My Graphite version is 1.2.0-dev, but on previous versions this didn't work too.

Jacket
  • 844
  • 10
  • 18
  • Have you looked at [TransformNull](http://graphite.readthedocs.io/en/latest/functions.html#graphite.render.functions.transformNull)? – MrDuk Mar 23 '18 at 19:55
  • Yes, unfortunately with no effect. e.g. `countSeries(transformNull(filterSeries(filterSeries(opennebula-performance.zones.opennebula-innologica.vms.3DC.*.vm_lcm_state, 'min' , '>', 35 ), 'max', '<', 51)))` doesn't change anything. – Jacket Mar 23 '18 at 20:02
  • Have you tried changing the order, so that `transformNull` is closer to the series? – MrDuk Mar 23 '18 at 20:07
  • Yes, I've placed it virtually everywhere with no effect. I've been banging my head with this for the last two days now... Even updated Graphite to the latest version... – Jacket Mar 23 '18 at 20:12
  • Just re-read your question, how about [KeepLastValue](http://graphite.readthedocs.io/en/latest/functions.html#graphite.render.functions.keepLastValue) – MrDuk Mar 23 '18 at 20:25
  • Yes, again the same thing. I believe the culprit is `countSeries`. It's just expected that all other functions can return an empty set, but in my opinion `countSeries` should always return series, even with zeroes. Maybe it just can't get the correct date points this way... I don't know. Thanks for trying to help. – Jacket Mar 23 '18 at 20:34

0 Answers0