Visualise If metric is variable (Icinga+Influx)?

I have data where metric is variable and I would like to visualize data about memory and CPU usage like Newrelic or ELK. Is it possible to realize?

Performance data is like this:


The first column is variable.

Query is:

SELECT mean("value") FROM "top_program_of_linux_memory_usage" WHERE ("hostname" =~ /^$hostname$/ AND "service" = 'Top_app_program_of_linux_memory_usage' AND "metric" =~ /(..).*/) AND $timeFilter GROUP BY time(5m) fill(none)

As result, I would like to see 10 (all or more) lines/column on a graphs something like to the picture.

If you want to show all the programs, group by a tag/field that contains the program name.

If you only want to show the first 10 using the most memory, at first glance, you need to calculate the mean usage of memory over a period of time for all programs, then sort from largest to smallest and keep the first 10.

I don’t think it’s possible at this time to do that with InfluxQL. There’s no sort function as far as I know. If you want to limit the number of series, there’s a SLIMIT clause in InfluxQL but I don’t know in which order it will limit.

It might be possible with Flux as it contains a sort function but Flux is still in beta phase so it might not be usable right now.

1 Like